我每次推送时如何让git询问用户名和密码? [英] How do I make git ask for a username and password every time I push?

查看:490
本文介绍了我每次推送时如何让git询问用户名和密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我工作的地方,很多人在同一个帐户上使用同一台计算机。我们现在只是为了方便而使用shell而不是ui。第一次有人提出要求他们的用户名和密码,但之后只是用他们的帐户进行所有提交。对不起,我对shell不太了解,但这是我第一次使用它。我用来提交和同步的命令是。

Where I work many people use the same computer on the same account. We now use the shell instead of the ui 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 sync are.

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

感谢您的帮助

Thanks for the help

推荐答案

看来用户的凭证正被缓存。

It seems that user's credentials are being cached.

转到您的项目,打开 .git / config 并删除行

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

[credential]
    helper = store
    # or helper=cache

检查 git-credential-store 获取更多信息。

这篇关于我每次推送时如何让git询问用户名和密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆