How to remove cached credentials from Git?

前端 未结 5 1174
臣服心动
臣服心动 2021-01-30 20:43

I ran:

$ git config credential.helper store

And then:

$ git push origin master

After pushing, I entered my creden

相关标签:
5条回答
  • 2021-01-30 20:52

    Your credentials are stored in the file you (or the thing using git credential-store) specified when you (or it) ran the command, as described in the documentation. The default is $HOME/.git-credentials. You should be able to open this file in your editor and edit it, or simply remove it entirely.

    Note that you may also want to change the credential helper so that these are not stored again. See the git credential-cache documentation as well, for instance.

    0 讨论(0)
  • 2021-01-30 20:56

    Run the following command in the terminal to remove your credentials stored in the cache

    git config --global --unset credential.helper
    
    0 讨论(0)
  • 2021-01-30 20:56

    None of the above solutions worked for me. I revoked the access by deletion of the token I had generated the machine.

    I logged into GitHub webpage went to: click picture > settings > Developer settings > Personal access tokens > delete the token for that particular machine

    0 讨论(0)
  • 2021-01-30 20:59

    If you would like the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an exit action, run the following command.

    git credential-cache exit

    0 讨论(0)
  • 2021-01-30 21:06

    As he did not give any flag as global or local or system, it would take local by default, so the correct way is to move to the respective folder(repository) and type this command

    git config --local --unset credential.helper
    

    or

    git config --unset credential.helper
    

    Reference: https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config

    0 讨论(0)
提交回复
热议问题