git-credential.helper=cache永远不会忘记密码



我想忘记我的密码,所以我必须再次键入。

我设置了这个:

git config credential.helper 'cache --timeout=600'

但过了好几天,它仍然记得密码,不再问我。。。

git版本1.7.10.4(在Ubuntu上)

我碰到虫子了吗?(我看到了类似的问题,但没有一个我找到答案…)

编辑:还是我错过了什么?

编辑:现在我知道commit是本地的,push是远程的。但我的提交(使用RabbitVCS Git nautilus插件)似乎正在执行push,因为远程回购正在更新。。。当我发布push时,它确实会询问密码。。。但对于CCD_ 5命令,它不要求AND执行远程更新;我检查了4小时前我的commit更新了远程服务器:(

问题1:git "希望忘记我的密码"

问题2(隐含):矛盾的配置设置

答案

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

解释:Git配置在三个地方指定:

  1. (repository_home)/.git/config…………..用于主题存储库
  2. ~/.gitconfig…………..用于此特定用户
  3. /etc/gitconfig。。。。。。。。。。。。。。。。。。。。。。。适用于此系统上的所有用户

上面提到的命令将删除存储库、用户和系统级别上与凭据相关的所有设置。。。这(我认为)回答了你的问题。

然而,听起来您的问题可能仅限于与一个凭据选项相关的某种配置矛盾。帮助,缓存。如果您只想重置该选项,请执行以下操作:

git config --unset credential.helper 'cache'
git config --global --unset credential.helper 'cache'
git config --system --unset credential.helper 'cache'

然后将超时设置在适当的级别,任意一个:

git config --set credential.helper 'cache --timeout=600'
git config --global --set credential.helper 'cache --timeout=600'
git config --system --set credential.helper 'cache --timeout=600'

有关更多信息,请参阅此处的优秀文档:

  1. git-config命令
  2. git凭据缓存

最新更新