错误。
Cloning into 'project_name'...
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://my_user_name@example.com/my_user_name/project_name.git/'
如何修复它?
Cloning into 'project_name'...
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://my_user_name@example.com/my_user_name/project_name.git/'
如何修复它?
打开CMD(以管理员身份运行) 输入命令:
git config --system --unset credential.helper
然后输入Git远程服务器的新密码。
git config --global--unset credential.helper
。 - Luca Natali在我的情况中,我使用的是Git Credential Manager for Windows(它是默认安装的,我没有手动安装)
Credentials Manager保存了我的旧密码,但我最近已经更改了它。
如果您处于相同的条件下,解决此问题的方法是: 进入控制面板->凭据管理器,并删除Git帐户。 然后它会再次要求您输入凭据。
对我的情况而言,我最初尝试使用
git config --system --unset credential.helper
但是我收到了错误提示
error: could not lock config file C:/Program Files/Git/etc/gitconfig: Permission denied
然后我又尝试了
git config --global --unset credential.helper
没有错误提示,但是在Git拉取时仍然遇到了访问被拒绝的错误。
接着我去了“控制面板” -> “凭据管理器” > “Windows 凭据”并删除了Git账户。
之后再次尝试Git拉取时,它会请求输入凭据,并且一个新的Git账户会添加到凭据管理器中。
http://{srvName}/{userInGitLab}/{Repository.git} 结尾不要加'/'
这可能是由于密码更改导致的,因为Git凭据管理器缓存了密码,所以如果是这种情况: 1. 在Windows中打开凭据管理器 2. 搜索您的GIT凭据并将其重置为新密码。
在Ubuntu 20.04中,
VSCode终端无法进行拉取/推送操作
返回以下错误信息:
remote: HTTP Basic: Access denied
fatal: Authentication failed for
只需在文件夹位置打开普通终端 git pull/push 就可以正常工作了
前往凭证管理器 => git 凭证 检查您的 git 凭证并检查密码。
这对我起作用了。
或者在现有存储库中使用此命令将远程设置为http,并使用此命令git remote set-url origin https://gitlab.com/[username]/[repo-name].git
在您的计算机进行任何与 git 相关的交易之前,git 会检查您的身份验证方式,可以使用以下方法进行身份验证:
简单地说,这是因为存储在您的计算机中的凭据不是真实的,即您在计算机中存储的密码可能已经与 git 中的不同了,因此
前往控制面板,搜索凭据管理器,查找您使用的 git url 并更改凭据即可。
这样就可以解决大多数 Windows 跟踪的问题了。