MAS MAS - 1 year ago 107
Git Question

my old username is still in use

I have changed my user and email for git with those commands

git config --global "maa"
git config ""

I confirmed the change with

git config --global
git config

and it shows the right names.
However when I push the old user name is used:

git push -u origin master
remote: Permission to maa/brain.git denied to old_user_name.
fatal: unable to access '': The requested URL returned error: 403

Answer Source

The and settings are only used for commit meta data.

As I can see you are using https transport, so the username is stored somehow. To my mind there are two options:

  1. You are using %HOME%/.netrc
  2. Your username is included in the push-url (like, here you need to update .git/config, e.g. by issuing git remote set-url https://<newusername><newusername>/yourRepo
  3. You are using a git credential helper. Here it depends which one you use (and maybe which OS you use, see for Windows, Mac OS X).

As a general rule you can try the following on the CLI (based on 2), where you replace $credentialhelper with your credential-helper (you can find it using git config credential.helper, for Mac OS X it is likely osxkeychain on Windows it might be wincred or manager):

$ git credential-$credentialhelper erase
[Press Return]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download