1

Unable to make commits to my new github account repositories from my local terminal.

remote: Permission to <new-account-name>/22c.git denied to <old-account-name>.

I have updated my global 'git config' settings`

git config --list

reveals the following:

credential.helper=osxkeychain
core.editor=/usr/bin/vim
core.autocrlf=input
user.name=<new-account-name>
user.email=<new-email>
push.default=simple
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/<new-account-name>/22c.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

thank you for the help, let me know if there is anything else that would help solve the problem

Alexander McNulty
  • 870
  • 1
  • 11
  • 19

2 Answers2

1

Note that user.name=<new-account-name> has nothing to do with authentication to GitHub as <new-account-name>: it is just about authorship associated to commits.

Your credentials are probably cached in your git credential helper osxkeychain: you need to update them there.
See "Updating credentials from the OSX Keychain". In command line:

git credential-osxkeychain erase
host=github.com
protocol=https
[Press Return]

If it's successful, nothing will print out.
To test that it works, try and clone a repository from GitHub. If you are prompted for a username/password, the keychain entry was deleted.

See more at "How do you reset the stored credentials in git credential-osxkeychain?".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

the problem was in my, osxkeychain. click here for a well documented solution.

Alexander McNulty
  • 870
  • 1
  • 11
  • 19