How to change my Git username in terminal?

后端 未结 13 1810
予麋鹿
予麋鹿 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:19

    You probably need to update the remote URL since github puts your username in it. You can take a look at the original URL by typing

    git config --get remote.origin.url
    

    Or just go to the repository page on Github and get the new URL. Then use

    git remote set-url origin https://{new url with username replaced}
    

    to update the URL with your new username.

提交回复
热议问题