Rogach
Rogach

Reputation: 27190

Why github does not recognize my username in my commits?

I have two repositories on github, and my usernames on github and my local git name match. But for some reason github does not attribut my commits to me - so in statistics, there are no commits by the owner, only by some user with the same name. What could cause such behaviour?

Upvotes: 30

Views: 14579

Answers (3)

smessing
smessing

Reputation: 4350

Have you checked what e-mail address is associated with the commit message? I believe GitHub only attributes commits to you if the e-mail address associated with the commit is also connected to your GitHub account...

See GitHub's cheat sheet for information about how to add e-mails to your git config:

git config --global user.email "[email protected]"

If you type:

git config --list

you'll see all your current git configuration settings.

Upvotes: 48

Alan M.
Alan M.

Reputation: 31

One of the reasons why my commits were not matching up to my user, is that although I was using the same email as in my user setting, the case of the email in the setting and the email in my terminal were not exactly the same. So for example, "[email protected]" is not the same as "[email protected]", although both will be allowed to push commits.

Upvotes: 2

KingCrunch
KingCrunch

Reputation: 131851

You probably use a different email address for your commits, that you defined within the github settings.

On the one side you can define as many email addresses, that should be associated with you, as you like in your accounts settings under "Emails" on github.com.

On the other side you should set "your" email address in your git config

git config --global user.email "[email protected]"

The reason is, that git (it's not githubs fault ;)) uses email addresses as identifiers for commits. The name is only to display it, when requested.

Upvotes: 10

Related Questions