从远端拉取拉取失败,sourcetree提示Authentication failed(下图)

我在解决此问题的过程中掌握了三个方案。
方案一:
在控制台输入下面命令,移除凭证。接下来就会弹出一个小窗口,提示你输入密码。
git config --system --unset credential.helper
补充存储凭证命令
// “cache” 模式会将凭证存放在内存中一段时间,并且在15分钟后从内存中清除。
git config --global credential.helper cache
// store” 模式会将凭证用明文的形式存放在磁盘中,并且永不过期。除非你修改了你在 Git 服务器上的密码
git config --global credential.helper 'store --file ~/.my-credentials'
方案二:
找到文件目录C:\Users\PongLyon\AppData\Local\Atlassian\SourceTree 并删除passwd文件(记得把sourceTree关闭)。

重置之后会再次弹出身份验证窗口。


当你遇到像上图那样,Username输入为灰色不能输入且用户名是错误需要输入时:
同样打开文件目录C:\Users\PongLyon\AppData\Local\Atlassian\SourceTree。找到userhosts文件并删除,便能解决上图的问题。
方案三:
修改凭据,效果不是很明显。
打开凭据管理器,选中Windows凭据找在普通凭据里找到对应的网络地址点击编辑。

网友评论