DEV Community

Matthew Kohn
Matthew Kohn

Posted on

Missing GitHub Contributions? Double Check Configurations.

After recently graduating from Flatiron School's Software Engineering program, I noticed the contributions graph in my GitHub profile was looking deceivingly weak.

GitHub contributions before fix

This was incredibly frustrating for me, because I spent a lot of time over the last year on various projects & labs that this graph didn't seem to account for.

Every green dot here was either a contribution from a new repo, or a cloned repo from a lab. No other commit I made on any of my projects showed up here.

I pored over StackOverflow articles and the GitHub Guides looking for an answer. I found one article that I found useful titled "Why are my contributions not showing up on my profile?", which explains what counts as a contribution:

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 account on GitHub.com.
  • The commits were made in a standalone repository, not a fork.
  • The commits were made:
    • In the repository's default branch
    • In the gh-pages branch (for repositories with project sites)

This is great, but I needed help troubleshooting my situation.

That's when I called up the big guns, @stevewhitmore. He was nice enough to screenshare over a zoom call to troubleshoot why my commits weren't showing up as contributions. It was helpful talking out the problem and getting a second set of eyes on it.

After trying out a few things to eliminate what didn't work, such as changing my SSH key or testing commits from different branches in both of our accounts, we found the solution.


Unsplash image of hands holding a lightbulb

Photo by Riccardo Annandale on Unsplash


The Solution

It turns out, I had two different email addresses set up locally and in my GitHub account.

In my terminal, I checked my locally configured email address with git config --global user.email. This revealed my locally configured email was set to my hotmail account, while my GitHub profile's email was set to my gmail account.

Rookie mistake, easy to fix.


1. Configure GitHub Email Locally

First, I made sure to set up my local machine's GitHub configured email to the same email address in my GitHub profile, my gmail account. In my terminal, I used:

git config --global user.email ko.....@gmail.com

I tested out to see if I could push up a local commit by adding a blank line to a README.md I recently pushed, then committing it.

git add README.md
git commit -m "test commit"
git push
Enter fullscreen mode Exit fullscreen mode

In my GitHub account, I confirmed this commit was received, and a green contribution box showed up for this commit.


2. Add Email Used in Past Commits to GitHub Settings

Next, I went into my GitHub Settings.

GitHub settings dropdown

On the left side of the settings page, under 'Access', click on the 'Emails' tab. This is where I confirmed my gmail account was my primary email address.

I then added the hotmail account I was using locally up until now as an additional email address.

Before:

Image description

After:

After email settings

Once I verified my additional email address by following the link sent by GitHub, I navigated back to my GitHub profile contributions page.

GitHub contributions after fix

Now, all contributions I made (past commits, new repos, and forks) over the past year show up on my contributions graph.

🎉

What a relief! This is a much better representation of my engagement with coding during school while working part-time.


In Closing,

This was a solution to my specific problem of contributions not appearing in my GitHub profile.

You may or may not have the same problem, if you did I hope this helps. If not, keep digging for the solution, and don't be afraid ask for help if you get stuck. I believe in you.

Huge shoutout to @stevewhitmore for your help. Thank you, I might have never figured it out without you.

Happy coding!

Top comments (0)