git credential.helper=cache never forgets the password?

前端 未结 1 1016
情深已故
情深已故 2020-12-05 19:50

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\'
相关标签:
1条回答
  • 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
    0 讨论(0)
提交回复
热议问题