How do I make Git ask for a username and password every time I push?

后端 未结 2 1218
臣服心动
臣服心动 2020-12-31 02:32

Where I work many people use the same computer on the same account. We now use the shell instead of the GUI just for convenience.

The first time someone committed it

相关标签:
2条回答
  • 2020-12-31 03:17

    If you use a Windows system, the Git username and password is stored in a control panel. You can go to Control PanelUser AccountsCredential Manager:Generic Credentials to delete it.

    0 讨论(0)
  • 2020-12-31 03:28

    It seems that users credentials are being cached.

    Go to your project, open .git/config and remove the lines:

    [credential]
        helper = store
        # or helper=cache
    

    Check git-credential-store for more information.

    Edit: OP mentions in the comments that this is happening in Windows, for which, the other answer is more relevant for removing the credentials from the Control Panel.

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