So recently, I started using GitHub after building projects & after pushing my code on GitHub I was having an issue with my contributions graph - All of my commits were not showing up.
After lots of googling, support emails & help from people who are knowledgeable about git on discord community I figured out the issue.
There's the official GitHub article on Why are my contributions not showing up on my profile?
Commits
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:
So after going through this GitHub doc, I found that the actual issue was with the Condition 1 -
The email address used for the commits is associated with your GitHub account
The issue I was experiencing was with the GitHub Desktop, email address wasn't matching with my GitHub account.
- My GitHub email looked like
test.name.ok@gmail.com
- My GitHub Desktop email was
test-name-ok@gmail.com
this was the issue incorrect email!
If you're experiencing the same issue head over to the options tab in GitHub Desktop and make sure your desktop email is similar to your GitHub account.
Steps: File > Options > Git
Once I figured out the cause of the issue, I needed to fix my contributions graph so all of my commits will be back on my graph. I ran this script on each of my repositories to update the user info to the correct email address, voila! my commits were showing on the graph!
How to know if this is the issue you're facing?
Check your commit history for one of your repositories, If you don't see your avatar on your commits next to different commits, but you have avatar on your GitHub profile, you're probably not using the correct email for 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.
After I fixed the email issue, all of those commits showed my avatar, As you can see in below image.
Conclusion
If you are not seeing your contributions 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 GitHub Desktop you use for version control on your local development environment.
Thank you for reading
Top comments (11)
An important thing to pay attention is that commits will appear on your contributions graph when made in the default branch. If you're developing in different branches, then graph will only update when the branch is merged on the default branch (the commits will appear according to the commit date, independently on the merge date).
Damn that's the critical part! I thought my email must have changed, but it's just me working on a feature branch! Thanks (y)
Helpful article, just to add in case you are not using GitHub desktop, you also can set your commit email address by command line.
$ git config --global user.email "email@example.com"
$ git config --global user.email
docs.github.com/en/free-pro-team@l...
This is Great! Thanks :)
But it the Github doc it is mentioned that if we commit to the forked repo and then open a pull request and it gets merged to the parent repository then those commits will show up in our contribution graph. But it is not showing. What might be the issue?
The script you linked doesn't seem to load
Hey Elias! Thanks for informing, I think that article has been removed from the docs. You can refer to this stackoverflow answer. It has the script.
Why on Earth is this a rule?
yes , i was also facing the same issue not knowing like a clown that commiting to a forked repo will not show up in the contribution graph haha lol
I was commiting in a fork even though it was showing in the forked repo page , but not in the contribution page , so LOL π
thanks alot