【发布时间】:2020-04-03 19:57:36
【问题描述】:
我有一段时间没有在我的 github 帐户上推送代码了。
今天我尝试了
git push -u origin master
我的命令提示符(Anaconda)要求我输入我的 github 用户名和密码
登录失败,使用 ctrl+c 取消基本凭据提示。
“https://github.com/”的用户名:我的用户名
我输入了这些,然后提示回复:
致命:无法获得凭证存储锁:文件存在
我可以毫无问题地推送代码,但我希望不必每次都输入用户名和密码。
我做了一些搜索,发现我遇到的错误在这个thread 中突出显示,其中建议该错误是由 git 配置中有多个credential.helper= 代码行引起的。还建议只保留其中一行,以调整错误。
所以,通过输入
git config --list
我发现我的 .git/config 文件中有两条代码行 credential.helper=。
一个在系统config文件中,一个在全局config文件中
git config --list --system
credential.helper=manager
git config --list --global
credential.helper=store
但在我的 .git/config 文件中,我找不到任何以 credential.helper= 开头的行。
那么我在哪里可以找到这些行?
我应该删除credential.helper=store 或credential.helper=manager 以避免每次都输入我的凭据吗?
【问题讨论】:
标签: git credentials git-config credential-manager