git credential.helper=cache 永远不会忘记密码?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18157583/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git credential.helper=cache never forgets the password?
提问by Aquarius Power
I want my password to be forgotten, so I have to type it again.
我想忘记我的密码,所以我必须再次输入。
I have setup this:
我已经设置了这个:
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 version 1.7.10.4 (at Ubuntu)
git 版本 1.7.10.4(在 Ubuntu 上)
did I run into a bug? (as I see similar questions but none I found that answers this...)
我遇到了错误吗?(因为我看到了类似的问题,但我发现没有一个可以回答这个问题......)
EDIT: or am I missing something?
编辑:或者我错过了什么?
EDIT: 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 :(
编辑:现在我知道commit
是本地的,并且push
是远程的。但我的提交(与RabbitVCS Git的鹦鹉螺插件),似乎是在执行push
远程回购正在更新...当我发布push
,它做询问密码...但与commit
命令它不问,并执行远程更新; 我在 4 小时前检查过我commit
更新了远程服务器:(
回答by HisHighnessDog
Problem 1: "want my password to be forgotten" by git
问题 1:git “希望我的密码被忘记”
Problem 2 (implied): contradictory configuration settings
问题2(隐含):矛盾的配置设置
Answer:
回答:
git config --unset-all credential.helper
git config --global --unset-all credential.helper
git config --system --unset-all credential.helper
Explanation:Git configuration is specified in three places:
说明:在三个地方指定了Git配置:
- (repository_home)/.git/config...........................for the subject repository.
- ~/.gitconfig..........................for this particular user.
- /etc/gitconfig.......................for all users on this system.
- (repository_home)/.git/config.................................. 用于主题存储库。
- ~/.gitconfig ......................对于这个特定用户。
- /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.
上面提到的命令将删除与存储库、用户和系统级别的凭据相关的所有设置......(我认为)回答了您的问题。
However, it sounds like your problem may be limited to having some sort of configuration contradiction related to oneoption of credential.helper, cache. If you'd prefer to reset only that option, do this:
但是,听起来您的问题可能仅限于与credential.helper, cache 的一个选项相关的某种配置矛盾。如果您只想重置该选项,请执行以下操作:
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:
有关更多信息,请参阅此处的优秀文档: