Skip to main content

Command Palette

Search for a command to run...

Don't lose your Github contributions when you leave an organization

Best practices for leaving your company

Updated
3 min readView as Markdown
Don't lose your Github contributions when you leave an organization
V

Senior Frontend Engineer @ Razorpay

As Software engineers there are often times in our careers when we change jobs, now this is a good thing since you get a significant raise 💰, the excitement of joining a new organization is also there and maybe you are also re-locating (to Bangalore?) to a new place.

In this excitement, most of us forget that soon you will be kicked out of your previous Github organization, where you might have made hundreds if not thousands of commits during your tenure and once you are kicked out, all of these commits will disappear in a ✨ jiffy ✨ from you Github profile.

If you are someone like me who cares deeply about their Github profile, then you will be in deep regret (like this person) if you don't do the needful to retain those contributions on your profile. A Github profile for software engineers is like their resume or at least I treat it like one, hence it's important to keep it up-to-date, authentic and relevant. Having a consistent contributions graph on your Github profile helps you get noticed by possible future recruiters and in general, it shows your consistency as a software engineer.

You can checkout my Github profile here

Now let's get into the meat of it 🎯

It is important to understand when commits are shown

Commits will appear on your contributions graph if they meet all of the following conditions:

  1. The email address used for the commits is associated with your account on GitHub.com.
  2. The commits were made in a standalone repository, not a fork.
  3. The commits were made in the repository's default branch

In addition, at least one of the following must be true:

  • You are a collaborator on the repository or are a member of the organization that owns the repository.
  • You have forked the repository.
  • You have opened a pull request or issue in the repository.
  • You have starred the repository.

So what can I do to keep my hard-earned contributions?

Star the repositories you are contributing to in your organization. That way, your commits to those repositories will remain in your contributions graph even if you leave the organization that owns the repository or delete your fork of the repository.

Before you leave your company, make sure you update the following information in your personal account:

  1. Unverify your company email address by deleting it in your Email settings. You can then re-add it without verifying to keep any associated commits linked to your account.

  2. Change your primary email address from your company email to your personal email.

  3. Verify your new primary email address.

FAQs

1) Regarding the advice to star the repos before leaving, does this mean that only commits post-starring will remain? Or is starring once sufficient to retain all past commits?

Ans - all commits will remain, so star the repositories as soon as you can just in case.

2) What if commits were made using a company email?

Ans - Unverify your company email address by deleting it in your Email settings. You can then re-add it without verifying to keep any associated commits linked to your account. ( refer )

References

  1. https://github.com/isaacs/github/issues/1138
  2. https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/best-practices-for-leaving-your-company
  3. https://github.community/t/getting-all-your-commits-in-your-contributions-graph/10186
  4. https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/managing-contribution-graphs-on-your-profile/why-are-my-contributions-not-showing-up-on-my-profile

If this blog helped you then please share it with other engineers out there, I don't want any engineer to lose their contributions ever :)

Comments (20)

Join the discussion
M

Can you add the unverified email after leaving the organization and still get the correct credit for contributions? And if yes, is there any mechanism to prevent taking other people's credit simply by adding unverified email accounts to your profile?

S
Sachindra2y ago

But what if Github is managed as an enterprise repository and the organization does not allow any external collaboration??

V

gist.github.com/Vikram710/098db6fb8da22864a8bfbb6e2f1c1d4f a simple script to star the repos that you contributed in your organization

P

I tried to recreate this. I created a private repo and gave access to another account B. Made a commit with GitHub interface using account B and the private contribution was showing up right everywhere. I starred the repo from account B. And removed access to account B.

The contribution was gone. Am I missing something? How do I make this work?

V

This is great and Thanks for sharing but I think it wont work in my case because I have two GitHub accounts(One for Personal and another was given to me by company) and All the repository are private. Is it possible to transfer? (I don't think so).

L

cool!!! It's really helpful

1
R

I had no idea this would happen. 😮 Thank you very much, Vikrant Bhat!

1
C

Hi, I tried this with the method that consists in putting a star on the repository of the organization before leaving it but I still lost my commits, do you know why?

1
R

Same here, I tried the star method but It is not appearing. We have an OAuth method to sign into the org, do you think this could impact?

D

I had no idea this was even a thing. Thanks a lot for sharing. Definitely going to star the repo now.

2
K

Probably something I wouldn't have otherwise known about. I'm not planning on leaving my role anytime soon 😄, but it's a cool little thing to know and I'm sure others will appreciate!

Thanks for sharing Vikrant!

2
V

Thank you for the kind words Kieran Roberts