How to change my Git username in terminal?

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

    1. In your terminal, navigate to the repo you want to make the changes in.
    2. Execute git config --list to check current username & email in your local repo.
    3. Change username & email as desired. Make it a global change or specific to the local repo:
      git config [--global] user.name "Full Name"
      git config [--global] user.email "email@address.com"

      Per repo basis you could also edit .git/config manually instead.
    4. Done!

    When performing step 2 if you see credential.helper=manager you need to open the credential manager of your computer (Win or Mac) and update the credentials there

    Here is how it look on windows

    Troubleshooting? Learn more

提交回复
热议问题