简体   繁体   English

如何在 git bash 中更改我的凭据?

[英]How to change my credentials in git bash?

I need to change username and password from host.我需要从主机更改用户名和密码。 When I use $ git config --global credential.helper default , it should ask new user and password next time I'm working with repo, but it isn't works.当我使用$ git config --global credential.helper default ,下次我使用 repo 时它应该询问新用户和密码,但它不起作用。

Hot to change my username and password?想更改我的用户名和密码?

Ensure you use ssh url for the repo rather than https and then try running:确保对 repo 使用 ssh url 而不是 https,然后尝试运行:

git config --global user.name myusername git config --global user.email myemail git config --global user.name myusername git config --global user.email myemail

I got myself here having the same problem and I found the solution in the git docs.我在这里遇到了同样的问题,我在 git 文档中找到了解决方案。 Write the following lines and everything should be fine, for your next commhrigit sits.写下以下几行,一切都应该没问题,因为你的下一个 commhrigit 坐。

$ git config credential.helper store
$ git push http://example.com/repo.git
  Username: <type your username>
  Password: <type your password>

Here is a link to the docs : git scm这是文档的链接: git scm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM