Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 4

Commits are under another account: wrong

I have multiple github accounts.

 

When committing and pushing to ALPHA account my commits are appearing on github as being done via my BETA account. I want my ALPHA commits to be executed via my ALPHA account.

 

A solution I tried was deleting all github-related certifications in Windows Credential Manager (this actually solved a related issue that was generating a bash commit 403 permission denied error). Now, I am not getting errors but am getting the above problem.

 

There seems to be no real downside other than the repository contribution graph is not being updated.

3 Replies
Commander Lvl 3
Message 2 of 4

Re: Commits are under another account: wrong

Hi @sklanglykrangly  and welcome,

 

GitHub does not care which account you use to push the commits. It just uses the account to verify if you have the rights to push. What really matters is the commit mail address. This is the address that made the commit. You can read more about it here: https://help.github.com/en/articles/about-commit-email-addresses

 

If you make a commit with an email address that is associated to your alpha account, but push it to GitHub using your beta account, it'll still show up as if it were coming from your alpha account since the commit mail address of that commit is associated with your alpha account.


- Mark
Copilot Lvl 2
Message 3 of 4

Re: Commits are under another account: wrong

Thank you, Mark.

 

However, both accounts in question do have different primary email addresses.

 

 

- Scott

Commander Lvl 3
Message 4 of 4

Re: Commits are under another account: wrong

Hi Scott,

 

It does not matter that the two accounts have different primary mail addresses.

 

Git (not GitHub) "stamps" an e-mail address on each commit. When you push, GitHub would like to know who (actually: which account on GitHub) made the commit. Therefore, it searches it's database for the commit mail address and finds an account that has verified that mail address (either as it's primary or secondary mail).

 

It does not matter what account was logged in locally and used to push to GitHub. It just matters what mail address you instructed Git to "stamp" onto commits. Please do note that if you log in with GitHub locally that does not mean you instruct Git to use that mail address as a commit mail address. Please refer to the link in my previous post if you need more info about that.


- Mark