How to change my Git username in terminal?

后端 未结 13 1858
予麋鹿
予麋鹿 2020-12-07 07:17

I was pushing and pulling from git in Terminal then I changed my username on github.com. I went to push some changes and it couldn\'t push because it was still recognizing

13条回答
  •  孤城傲影
    2020-12-07 07:20

    If you have created a new Github account and you want to push commits with your new account instead of your previous account then the .gitconfig must be updated, otherwise you will push with the already owned Github account to the new account.

    In order to fix this, you have to navigate to your home directory and open the .gitconfig with an editor. The editor can be vim, notepad++ or even notepad.

    Once you have the .gitconfig open, just modify the "name" with your new Github account username that you want to push with.

提交回复
热议问题