Missing GitHub Contributions? Double Check Configurations.
Tags: github, codenewbie, beginners
Published: 2022-11-07 01:01:26

After recently graduating from [Flatiron School's Software Engineering program](https://flatironschool.com/welcome-to-flatiron-school/software-engineering/), I noticed the contributions graph in my [GitHub profile](https://github.com/matthewkohn) was looking deceivingly weak.

![GitHub contributions before fix](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b35arqubc0908sblrkza.png)

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](https://stackoverflow.com/) articles and the [GitHub Guides](https://docs.github.com/en) looking for an answer. I found one article that I found useful titled ["Why are my contributions not showing up on my profile?"](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/managing-contribution-settings-on-your-profile/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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s01mkrwds0ngyn63vs32.png)

Photo by <a href="https://unsplash.com/@pavement_special?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Riccardo Annandale</a> on <a href="https://unsplash.com/s/photos/solution?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>

---

## 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
```

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zqid7oa7bg0jnngyyr4.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ywlz7rqrrhkxbeubyfyu.png)
#### After:
![After email settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rtwn5gk8b6gq25aexh1b.png)

Once I verified my additional email address by following the link sent by GitHub, I navigated back to my [GitHub profile](https://github.com/matthewkohn) contributions page. 


![GitHub contributions after fix](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zm0bdairdmh26splh5fh.png)


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!