我应该删除credential.helper = store还是credential.helper = manager以避免每次都输入我的凭据?

问题描述 投票:0回答:1

有一段时间我没有在我的github帐户上推送代码。

今天,如我所愿

git push -u origin master

我的命令提示符(Anaconda)要求我输入我的github用户名和密码

登录失败,请使用ctrl + c取消基本凭据提示。

'https://github.com/的用户名:myusername

https://[email protected]/的密码:

我输入了这些内容,然后提示回答:

致命:无法获得凭证存储锁定:文件存在

我可以毫无问题地推送代码,但我希望不必每次都输入用户名和密码。

我进行了一些搜索,发现此thread中出现了我所遇到的错误,在这里建议该错误是由于git配置中有多个credential.helper=代码行引起的。还建议通过仅保留这些行之一来调整错误。

因此,通过键入

git config --list

我发现我的.git / config文件中有两条代码行credential.helper=。一种在系统config文件中,另一种在全局config文件

git config --list --system

credential.helper =经理

git config --list --global

credential.helper = store

但是在我的.git / config文件中,我找不到以credential.helper=开头的任何行。

那么我在哪里可以找到这些行?

并且是否应该删除credential.helper=storecredential.helper=manager以避免每次都输入我的凭据?

git credentials git-config credential-manager
1个回答
0
投票

主目录中存在.git-credentials.lock卡住的文件。它可能以纯文本形式包含您的密码,因此您应该将其删除。

git-credential-store

使用此帮助程序会将未加密的密码存储在磁盘上,仅受文件系统权限保护。如果这是不可接受的安全性权衡,尝试git-credential-cache或找到一个与操作系统提供的安全存储集成。

您可以使用git-credential-store--show-origin选项显示设置来自哪个文件。

但是您也可以使用命令git config删除它。

© www.soinside.com 2019 - 2024. All rights reserved.