Logout and login as another user git bash

前端 未结 3 734
生来不讨喜
生来不讨喜 2020-12-30 23:01

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

I have googled but can\'t find any solution.

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-30 23:36

    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).

提交回复
热议问题