Alexander McNulty
Alexander McNulty

Reputation: 890

update local github account information

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

Upvotes: 1

Views: 145

Answers (2)

Alexander McNulty
Alexander McNulty

Reputation: 890

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

Upvotes: 0

VonC
VonC

Reputation: 1324547

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?".

Upvotes: 1

Related Questions