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

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

问题描述



我已经设置了这个功能:

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

但是很久以后,几天后,它仍然记得密码,不再问我这个问题......



git version 1.7.10.4(at Ubuntu)



是否遇到过错误? (因为我看到类似的问题,但没有人发现这个答案...)



编辑:或者我错过了什么?



编辑:现在我知道 commit 是本地的,并且 push 是远程的。但我的提交(使用RabbitVCS Git nautilus插件)似乎正在执行 push ,因为远程repo正在更新中......当我发出 push ,它会要求输入密码......但是使用 commit 命令,它不会要求并执行远程更新;我检查了4个小时前我的 commit 更新了远程服务器:(

解决方案

<问题1 :希望我的密码被遗忘by 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 .......................对于此系统上的所有用户。
  4. li>

上述命令将删除所有与凭据相关的设置(我认为)回答你的问题。



然而,这听起来像你的问题可能仅限于某种类型与> one 选项相关的配置矛盾的相关信息,其中包括credential.helper, cache 。如果您只想重置该选项,请执行以下操作:

  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凭证缓存


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)

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 :(

解决方案

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

Problem 2 (implied): contradictory configuration settings

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:

  1. (repository_home)/.git/config...........................for the subject repository.
  2. ~/.gitconfig..........................for this particular user.
  3. /etc/gitconfig.......................for all users on this system.

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 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 config command
  2. git credential caching

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

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