Reputation: 37506
I'm trying to set up multiple account credential management for github using these instructions and ran into a problem... Git continues to use my GitHub credentials even when I set up the user.name
and user.email
properties in the repo to match the work-related SSH key configuration I set up. No matter what I do, it keeps using my personal GitHub account as I see a request to push to the work repo denied to my personal account.
I've tried these steps to remove any credentials that might have been stored in the macOS keystore. It's behaving like it's completely ignoring the SSH configuration. Any idea how to fix this?
Upvotes: 2
Views: 172
Reputation: 5214
First, user.name
and user.email
has nothing to do with credential check (though sometimes it will be checked by server for identifying whether these commits are made by you, but not affect your question).
Second, you didn't mentioned about changing remote or changing repository, and the sites you mentioned didn't talk about it, too. So I am guessing what you have met now:
git push
it to your personal account.git push
the same repo to your work-related account.user.name
, user.email
, git credential-helper
(on macOS it is git credential-osxkeychain
), but those makes nothing, Git keeps warning you that you don't have permission to your personal account.If so, then I guess:
git remote add
or git remote set-url
for pushing it to your working account.Upvotes: 1