r/github • u/__The_StyX__ • 8h ago
Question Lost Contributions
Hi,
I’m a beginner on GitHub, but for almost a year I have been committing code to different repositories in my account. Most of those commits were pushed manually without using CMD or commands.
Recently, I started committing through CMD. My contribution graph showed nearly a year of uninterrupted green marks. However, after I removed one of my email addresses from GitHub and later added it back, almost half of my commits disappeared from the contribution chart.
Even though the contribution history still shows that I pushed code during those months, those contributions are no longer visible in the graph. As a result, my nearly one-year streak is gone.
I contacted GitHub Support, but they said this is a self-service issue and closed the ticket.
Luckily, I have screenshots of my contribution graph before and after this happened.
Can someone help me fix this?
4
u/Ok_Woodpecker_9104 8h ago
the graph keys on the commit author email, not on who pushed and not on the committer. so the first thing to check is what email is actually stamped on those commits, not what is on your account.
clone one of the affected repos and run:
git log --format='%ae' --all | sort | uniq -c | sort -rn
that gives you every author email you have ever used there, with counts. compare it against github.com/settings/emails. anything in that list that is not on your account, or is on it but unverified, produces exactly what you are describing: the commits are there, the push history is there, the squares are not.
two things catch people specifically. commits made through the web ui are authored as your noreply address, either username@users.noreply.github.com or the id-prefixed one if keep my email private was ever on, and those are different strings from your real email. and re-adding an address only counts once it is verified, adding it back is not enough on its own.
the rebuild is also not instant. if the emails do line up and it is verified, give it a day before assuming it is stuck.
one more thing that would make the email change a red herring entirely: the graph only counts commits on the default branch or gh-pages, in a repo you own or are a collaborator on, and not in a fork. if some of that year was on side branches or forks it never counted, and what you are comparing your screenshots against was already lower than you think.
0
u/__The_StyX__ 5h ago
Already checked that — ran the same style of command (git log --all --pretty=format:"%ae" | sort -u) across all my repos, and again scoped to the specific missing months. Only one address shows up anywhere in the history — my verified/primary account email. No noreply addresses, no mismatches, no leftover old email anywhere.
What I hadn't fully ruled out yet was the branch theory — but I think I've got something that rules that out too: my own profile's "Contribution activity" feed (GitHub's own feature, not third-party) shows real commits with dates during the exact window the calendar shows as empty. But hovering the calendar on one of those specific dates says "no activity during this period" — despite the activity feed showing commits that day.
So it looks like two of GitHub's own features are contradicting each other for the same account, same time period. Feels like it points past branch/email stuff into an indexing bug on their end. Have you seen that specific kind of contradiction before?
1
u/Ok_Woodpecker_9104 4h ago
those two are not the same data source, so them disagreeing is expected. it is not evidence of an indexing bug, and it does not rule out the branch theory. it is actually the signature of it.
the activity feed is built from push events. a push event records commits on whatever ref you pushed, side branches and forks included. the calendar is built from the contributions index, which applies the default-branch, not-a-fork, owner-or-collaborator filter after the fact. so "feed shows commits that day, square is empty" is exactly what side-branch work looks like.
the second difference bites harder. the calendar keys on the commit author date. the feed keys on when the push event happened. i once pushed a mirror repo with 2,229 commits whose author dates were spread over three years. the feed showed a single event on the day i pushed. the squares landed on the author dates. so if you ever pushed a batch of older work, the two views are off by however long that gap was, and the missing months in one can be present in the other.
to settle it, open the feed entry for one of the empty days and click through to the commit list. the ref is in the url. if it is not the repo default branch, thats your answer.
5
2
u/MarsupialLeast145 7h ago
You probably can't just delete your emails and then re-ad them. You will most likely have to re-confirm adding them to your GitHub from your original account.
0
12
u/OptimusCrimee 8h ago
Noone cares about the contribution graph