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

寵の児 提交于 2019-12-03 23:49:13

问题


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 asked for their username and password, but after that just used their account for all commits. I'm sorry that I don't know much about the shell, but this is the first time I'm using it. The commands I use to commit and synchronise are:

git commit -a
git push origin [branch name here]

回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/25735957/how-do-i-make-git-ask-for-a-username-and-password-every-time-i-push

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!