Logout and login as another user git bash

时光毁灭记忆、已成空白 提交于 2019-12-18 18:47:42

问题


I want to logout from Git bash and login it again as another user .

I have googled but can't find any solution.


回答1:


You don't have to "logout" or "login": regarding git, who you are is determined by:

git config user.name
git config user.email

Change those two settings while being in a repo, and you are someone else, when it comes to creating commits.

That has nothing to do with git remote -v, that is with the user account you will use to push to the upstream repo.

  • for an https url, you can simply specify a new user
  • for ssh, you would need a ~/.ssh/config file referring to multiple private ssh keys (also described here).



回答2:


use

git config --global user.name [Your User name]

git config --global user.email [Your Email]



回答3:


For Windows User: Follow Instructions: Control Panel >> User Account >> Credential Manager >> Windows Credential >> Generic Credential You can change git credential click modify>>provide uname and password Or you can remove git credential. next time when you'll push repo it'll ask you for credential.



来源:https://stackoverflow.com/questions/23740734/logout-and-login-as-another-user-git-bash

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