13

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

Aquarius Power
  • 3,729
  • 5
  • 32
  • 67
  • 1
    And I'm facing the exact opposite of this problem - even after specifying a timeout of 999999 (~11 days), it doesn't even remember it for half a day. – aalaap Sep 22 '16 at 05:20

1 Answers1

33

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
HisHighnessDog
  • 468
  • 4
  • 10
  • 6
    for newer versions of git change `--set` to `--add`. (see the doc in `git help config`) – epineda Apr 18 '17 at 21:03
  • @HisHighnessDog I have created `$HOME/.config/git/credentials` and set the `credential.helper` to store and it is not used at all when I do `git push`. Any idea why? – Dimitri Kopriwa Oct 01 '18 at 21:24