如何解决致命问题:git [bitbucket] 的身份验证失败

How to resolve fatal: Authentication failed for git [bitbucket]

我在获取或拉入任何客户端时一直面临问题。即 "Tower" 和 Sourcetree。一切进展顺利,我只是将 macos 更新为 Mojave。

但我总是得到

Error details: fatal: Authentication failed for 'https://username@bitbucket.org/sample/sample.git/'

您可以试试这个解决方案:

git remote add origin https://{username}:{password}@github.com/{username}/project.git

最好的方法是使用 Git 凭据管理器 (https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.18.1),或适合您的 OS 的凭据管理器。不要把你的 username/password 放在纯文本配置文件中(除非它是双空格..)

同样的错误(Windows,Git Bash命令行,bitbucket)。使用 https(不是 ssh)应该提示输入登录凭据但错误:

$ git pull origin master
fatal: Authentication failed for 'https://bitbucket.../my_git_project.git'
$ git config -l
...
credential.helper=manager
...

$ git config --global --unset credential.helper
$ git config --system --unset credential.helper

git pull 现在提示 username/password 提示。