I recently created a new branch, made some commits (a simple git commit -m
), and created a pull request in a repo that was not created by me. Github correctly recognises my username/email from ~/.gitconfig
, but sends email notifications containing the wrong username.
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = ddelange
email = [email protected]
As can be seen below, the commits are linked to me (as expected). Running git show 2f74892
also looks as expected.
Then, all people involved receive an unexpected email from [email protected]
, attributing my commit to the owner of the repo:
These emails are sent every time I git push
. Anyone ideas what's happening here?
So I contaced Github support as Justin Howard suggested. This was their response:
Hi there David,
Thank you for getting back to us with that.
I had a look at our logs for the repository and I do show @yrik pushing that commit.
We're attributing them to your account as you have your user.email set correctly but Git is authenticating as the other user. This is probably because you have that user's credentials cached in Keychain.
Can you follow the steps below and let me know if that helps you to resolve this?
https://help.github.com/articles/updating-credentials-from-the-osx-keychain
Thanks, Steve
Removing (my) credentials from the keychain, and logging into git cli again with 2fa stopped the erroneous notifications.
Since I have notifications for "my own activity" disabled, and I'm not watching the repository otherwise, I now don't get notifications anymore when I push commits, and other watching users receive correct email notifications.