Easily Change GitHub User in OSX
The first step is to run
git config -l to see what the current configuration is. If the
user.email properties are incorrect, change them using something like this:
git config --global user.name "Mark McFate" git config --global user.email "yourEMail@address.here"
That’s only half the battle. I love OSX and the Keychain Access app is wonderful, except when I’m working with git and GitHub in a terminal, which I do quite often. The real problem is that I have 4 different identities in GitHub… crazy, I know. Changing from one identity to another has been a real pain-in-the-a$$, up until I found this gem of a post.
Basically, what it tells me to do from the Keychain Access app is this:
- In Finder, search for the Keychain Access app.
- In Keychain Access, search for github.com.
- Find the “internet password” entry for github.com.
- Edit or delete the entry accordingly.
Works like a charm! The next
git... command I specify, if necessary, will prompt me for my GitHub username and password – or more appropriately, my
Personal Access Token, since I now have 2-factor authentication enabled – and those are automatically saved until I repeat the above process. Woot!
And that’s a wrap. Until next time…