After my post about How to build a good GitHub profile, I was having an issue with my contributions graph: all of my commits weren’t showing up.

After lots of digging, some support emails, and help from people knowledgeable with Git, I figured out the issue.

The GitHub docs article “Why are my contributions not showing up on my profile?” explains:

Commits will appear on your contributions graph if they meet all of the following conditions:

– The email address used for the commits is associated with your GitHub account.

– The commits were made in a standalone repository, not a fork.

– The commits were made:

— In the repository’s default branch (usually master)

— In the gh-pages branch (for repositories with Project Pages sites)

I thought I was experiencing an issue with condition 3.1: The commits need to be made in the repository’s default branch. I thought it was silly that my commits weren’t being counted because I was using a development branch, even though I was merging that branch with master. But I learned that when you merge two branches, the commits become part of the default branch and are counted in the contributors graph.

The repository contributors graph only shows contributors who have committed to the default branch of the repository. If you only have commits on an unmerged branch, you will not show up on the graph. — help.github.com

Once your contributions are merged into the default or gh-pages, you will get credited for them on the date you authored them. — stackoverflow

So using a development branch wasn’t the issue.

After lots of digging and testing, I learned that it wasn’t an issue with the branches I was using, it was an issue with condition 1: The email address used for the commits need to be associated with my GitHub account.

The issue I was actually experiencing was that the email address in the GitHub Desktop did not match the email address in my GitHub account. Even though you may have signed in to your GitHub account, you also need to manually enter the email address in the “Advanced” settings tab.

This is a usability bug in my opinion (though perhaps it has to do with someone pushing commits who didn’t also author the commit).

Once I figured out the cause of the issue, I needed to fix my contributions graph so all of my commits were accounted for. I ran this script on each of my repositories to update the user info to the correct email address. 106 commits added to my graph!

A tip for how to know if this is the issue you are facing: Check your commit history for one of your repositories. If you don’t see your avatar next to many of the commits, but you do have an avatar on your GitHub profile, you are probalby not using the correct email for some of your commits.

The image above shows a portion of the commit history for one of my repositories. After I fixed the email issue, all of those commits showed my avatar.

(You may notice that you still have the old email listed quite a few times in your public history. That email address is still showing because certain commits were originally made with the old email address.

However, if you actually navigate to that repository, you can see that the email address in those commits is now the new email address. So the old email address is just there in the public history as a historical record of when the commits were first made.)

So, lesson of the day: if you are not seeing your contributions show up on your graph, check that you are meeting all conditions, and be aware that it may be an issue with your email address used/not used correctly in the application you use for version control on your local development environment.