Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change my Git username in terminal?

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 my old username.. How do I change/update my username on git in terminal?

like image 301
user3370902 Avatar asked Apr 03 '14 17:04

user3370902


People also ask

Can I rename my github username?

Changing your usernameIn the upper-right corner of any page, click your profile photo, then click Settings. In the left sidebar, click Account. In the "Change username" section, click Change username.


1 Answers

  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 protected]"

    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 enter image description here

Troubleshooting? Learn more

like image 125
Oriol Avatar answered Sep 19 '22 05:09

Oriol