我在gitlab web ui中创建了一个存储库,并试图推送我的本地存储库.我使用以下命令添加了远程仓库:
$ git remote add origin test@x.x.x.x:project.git
Run Code Online (Sandbox Code Playgroud)
然后我试着推,但它错了.我不使用ssl.我想使用纯文本连接.
$ git push origin master
test@x.x.x.x's password:
Permission denied, please try again.
test@x.x.x.x's password:
Permission denied, please try again.
test@x.x.x.x's password:
Permission denied (publickey,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud) 我遇到了与之前发布的问题相同的问题,该问题未得到解答:Git for Windows - 推送时错误 403 访问被拒绝
我已经卸载并重新安装了git,并卸载了github桌面界面。OLDUSER 是我为一组文件拥有的另一个 github 帐户,我已删除所有这些文件并且没有在任何地方登录该帐户。NEWUSER 是我的新帐户,我计划从现在开始使用它。
我按照本教程从命令行使用 git 而不是 Windows-GitHub 界面。
$ git remote add origin https://github.com/NEWUSER/REPO.git
fatal: remote origin already exists.
$ git push -u origin master
remote: Permission to CURRENTUSER/REPO.git denied to OLDUSER.
fatal: unable to access 'https://github.com/NEWUSER/REPO.git/': The requested URL returned error: 403
$ git remote -v
origin https://github.com/NEWUSER/REPO.git (fetch)
origin https://github.com/NEWUSER/REPO.git (push)
$ git config git user.name
NEWUSER
$ git config user.email
EMAIL THAT BELONGS TO NEWUSER …Run Code Online (Sandbox Code Playgroud) 我在 Windows 10 中尝试使用 VS Code 克隆存储库时收到以下错误。 Visual Studio Code Git: 远程: TF401019: 名称或标识符的 Git 存储库不存在,或者您没有尝试执行的操作的权限。
开发人员拥有该存储库的完全权限,并且该项目确实存在于 Azure DevOps 中。
感谢您的帮助
佩德罗雷诺索
我已使用VSCode克隆了我的GitHub存储库之一,并进行了一些提交。当我完成第一次提交时,VSCode要求我提供我的GitHub密码。
我已经重新启动了计算机,现在可以像以前一样进行提交了,但是VSCode不会要求输入密码。似乎密码已存储。但是这台计算机不是我的计算机,我不希望其他人可以使用我的帐户。
如何使VSCode忘记我的GitHub密码?
我尝试过git命令吗?
git config --global --unset-all user.email
Run Code Online (Sandbox Code Playgroud)
但是VSCode仍然让我无需询问即可提交。
我最近在工作时更新了我的Github密码(公司Github帐户).我在我的一个VM上配置了Git,它是Windows 10.不管我做什么git pull,git push它都会抛出错误信息:
remote: Invalid username and password
fatal: Authentication failed for 'https://<my_project_repository>'
我尝试了许多在线可用的选项,但没有一个可以帮助提供用户名/密码提示.我甚至尝试卸载并重新安装它,但它也没有帮助.
我没有使用Git GUI.仅通过Git bash使用它.
有帮助吗?
我是 VSCode 和 Github 的新手,并且使用 Windows 10。我有 2 个 Github 帐户,一个“私人”帐户和一个“工作”帐户。我一开始使用“私人”,但我不再使用它了。我将 VSCode 帐户链接到“Work”并验证它已正确完成此操作。
现在,当我将文件从本地推送到远程时,它会继续使用“私人”推送它。所以我检查了如何解决这个问题并改变了两件事:
git config --global user.name和git config user.name,发现两者都显示为“私有”。所以我输入:git config --global user.name "Work"and git config user.name "Work",将两者更改为“工作”我希望这两个行动能够解决问题,但不幸的是它没有。还有其他地方我应该改变什么吗?
有没有一种快速的方法可以在 Windows 上的 cmd 中注销并使用不同的帐户重新登录 git?我试过:
git config --global --unset user.name
git config --global --unset user.mail
git config --global --unset credential.helper
Run Code Online (Sandbox Code Playgroud)
所以我知道我应该使用 old_user_name 注销?然后我用了:
git config --global user.name "new_user_name"
git config --global user.email "new_email"
git push origin master
Run Code Online (Sandbox Code Playgroud)
我做了一次按摩:
远程:old_user_name 对 new_user_name/new_repo.git 的权限被拒绝。致命:无法访问'https://github.com/new_user_name/new_repo.git/':请求的URL返回错误:403
这意味着我仍然使用旧帐户登录。我还可以做些什么?
我用这些命令改变了我的用户和电子邮件git
git config --global user.name "maa"
git config user.email "maa@gmail.com"
Run Code Online (Sandbox Code Playgroud)
我确认了这一变化
git config --global user.name
git config user.email
Run Code Online (Sandbox Code Playgroud)
它显示正确的名称.但是,当我按下旧用户名时使用:
git push -u origin master
remote: Permission to maa/brain.git denied to old_user_name.
fatal: unable to access 'https://github.com/maa/brain.git/': The requested URL returned error: 403
Run Code Online (Sandbox Code Playgroud)