1

I recently added a GPG key to my account on Github. After adding the key, a good chunk of my contributions disappeared making my profile look low activity.

I'm not one to care about the green squares but since I am job searching right now, I don't want potential employers seeing my profile like this...

Does anybody know why this could have happened and how to get the contributions back?

https://github.com/kdelalic

Contributions gone!

The cached version with all of the contributions can be seen here: https://webcache.googleusercontent.com/search?q=cache:_7rub6euS6IJ:https://github.com/kdelalic+&cd=1&hl=en&ct=clnk&gl=ca

Contributions from before

Karlo Delalic
  • 91
  • 1
  • 3
  • 9

2 Answers2

2

The activity should not be tied to your GPG key, unless you use it to sign your commits.

The activity should only consider your author name and email.
And I see in past commit (like PR 8) commits done by Karlo Delalic instead of your GitHub user account kdelalic.

You would need to rewrite the author of those commits (and force push, since it would change the history) in order to see your activity.

The OP Karlo Delalic confirms in the comments:

The older commit that doesn't count as a contribution anymore was accidentally made by my work email.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I understand what you are saying. The thing is that these commits have just recently been converted into "Karlo Delalic" instead of "kdelalic". So why have all of my contributions disappeared? You can see the cached version here: https://webcache.googleusercontent.com/search?q=cache:_7rub6euS6IJ:https://github.com/kdelalic+&cd=1&hl=en&ct=clnk&gl=ca – Karlo Delalic Dec 11 '19 at 05:06
  • @KarloDelalic Can you do a git show (as I mention here: https://stackoverflow.com/a/50826902/6309) on an old commit, and a recent one, to see if there is any difference? – VonC Dec 11 '19 at 05:08
  • Ok, I see what is going on. The older commit that doesn't count as a contribution anymore was accidentally made by my work email. Do you suggest that I rewrite the commit as you said above in your original answer? – Karlo Delalic Dec 11 '19 at 05:25
  • @KarloDelalic Yes, that would be the idea. That way, GitHub would be able to pick it up as part of *your* activity. – VonC Dec 11 '19 at 05:29
0

It is worth noting that contributions as they appear on your GitHub profile are tied to your email address rather than your GPG key.

That is, commits will remain attributed to you provided the email address is still associated with your GitHub account (I gather it may not have been possible in the OP's case to re-add the old email address), even if the GPG key associated with the email address has been deleted. Said commits will now always be unverified (unless the GPG key can be recovered).

I found this all out the hard way yesterday! The steps I took following an organisation rename and the results (bear in mind that all previous commits to org repos had been signed with this email address/GPG combo):

  • Removed old GPG key and old email address from GitHub -> old commits went to having no committer and being unverified, and profile activity for these commits vanished
  • Re-added old email address to GitHub account (still had access to inbox for verification) but not old GPG key (lost access) -> old commits were still unverified but once again attributed to me, and profile activity returned
Blair Nangle
  • 1,221
  • 12
  • 18