git credential.helper=cache 永远不会忘记密码? [英] git credential.helper=cache never forgets the password?

查看:27
本文介绍了git credential.helper=cache 永远不会忘记密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想忘记我的密码,所以我必须重新输入.

I want my password to be forgotten, so I have to type it again.

我已经设置了:

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

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

but much later on, several days, it still remembers the password and does not ask me it again...

git 版本 1.7.10.4(在 Ubuntu)

git version 1.7.10.4 (at Ubuntu)

我遇到了错误吗?(因为我看到了类似的问题,但我发现没有一个可以回答这个问题......)

did I run into a bug? (as I see similar questions but none I found that answers this...)

还是我遗漏了什么?

现在我知道 commit 是本地的,而 push 是远程的.但是我的提交(使用 RabbitVCS Git nautilus 插件)似乎正在执行 push 远程存储库正在更新......当我发出 push 时,它确实要求输入密码... 但是使用 commit 命令,它不会询问和执行远程更新;我在 4 小时前检查了我的 commit 更新了远程服务器:(

now I know commit is local, and push is remote. BUT my commits (with RabbitVCS Git nautilus addon) seem to be performing the push as remote repo is being updated... When I issue push, it do asks for password... but with the commit command it does not ask AND perform the remote update; I checked that 4 hours ago my commit updated the remote server :(

推荐答案

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

Problem 1: "want my password to be forgotten" by git

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

答案:

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

说明:Git配置在三个地方指定:

Explanation: Git configuration is specified in three places:

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

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

The commands noted above will remove all settings related to credentials at the repository, user and system level... which (I think) answers your question.

但是,听起来您的问题可能仅限于与 one credential.helper、缓存 选项相关的某种配置矛盾.如果您只想重置该选项,请执行以下操作:

However, it sounds like your problem may be limited to having some sort of configuration contradiction related to one option of credential.helper, cache. If you'd prefer to reset only that option, do this:

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

...然后将超时设置在适当的级别,以下任一项:

... then set the timeout at the appropriate level, any of:

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'

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

For more, see the excellent documentation here:

  1. git 配置命令
  2. git 凭据缓存

这篇关于git credential.helper=cache 永远不会忘记密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆