I have an issue with git and my terminal.
Here\'s a gallery to show you my issue : http://imgur.com/a/6RrEY
When I push commits from my terminal, git says I
What worked for me was to use the Github repo's https URL instead of the ssh URL. I went to the Github project page and copied the https URL into my clipboard, and then pasted it into the second command below:
git remote rm origin
git remote add origin https://[...]
clearing keychain didn't help... I had to ssh-add -D
and re-add the key with ssh-add <keyfile>
I solved this problem removing (or renaming to *.bak) the id_rsa and id_rsa.pub file on MacOS High Sierra. Idea from here.
I have custom host redirects in ~/.ssh/config that should be applied but used wrong user before I renamed the two files...
I had a similar issue and it turned out that the problem was the fact that the public key file contained my email address on the last line. That seemed to override the User setting in my config. As soon as I removed my email from the .pub file (and re-uploaded to my repo) Git connected using the correct user.
it looks like my terminal does the commits with my username, but pushes them with the other one
Author and committer name and email (which are important for GitHub) are derived from:
git config user.name
git config user.email
However, as mentioned in git config and git commit-tree, those values can be overridden by environment variables:
GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
So double-check those variables.
Things work back normally if I force the user in the
.git/config
of a repository but I don't think that's the good option.
But it should be a good solution.
When using an https url, I always specify the user in it to make sure the authentication is done with the right user.
http://USER@github.com/USER/REPO.git
I just had this problem at work. The builtin git that ships with mac or comes when you install xcode caches git credentials in keychain. The fix for me was to:
start keychain access (start spotlight via cmd + space, type keychain, press enter)
Under keychains on the upper left, select "login" Under category on the left, select "passwords"
find the name "github" and delete it.