How to change my Git username in terminal?

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

    Firstly you need to change credentials from your local machine

    1. remove generic credentials if there is any

    1. configure new user and email (you can make it globally if you want)
    git config [--global] user.name "Your Name"
    git config [--global] user.email "email@address.com"
    
    1. now upload or update your repo it will ask your username and password to get access to github

提交回复
热议问题