Showing private contributions on your GitHub profile
Post from @manuel_frigerio on X

Showing private contributions on your GitHub profile

Yesterday, I saw a post from Ryan Peterman suggesting that the only way to display contributions on your GitHub profile is if you work on side projects in public repositories.

The image appears to be a screenshot of a social media post from a user named Ryan Peterman, who describes himself as a Staff Software Engineer at Instagram and mentions his website. He's shared his thoughts on why he hasn't written much code outside of his full-time job, highlighting two benefits of coding at work: faster career growth and quicker learning due to full-time work and peer feedback. He mentions that while side projects are beneficial for learning and passion projects, they are not a requirement for staying on top of the job market. Below his post is a reply from another user, Manuel Frigerio, suggesting that one should not apply for a Senior dev position if their Github activity looks sparse, accompanied by a visual of a Github contributions graph showing only one contribution in the last year. The post has various engagements including likes, retweets, quotes, and comments.
Ryan Peterman's post suggests that the only way to display contributions on GitHub is if you contribute to public projects. Most people commenting there don't know that this is FALSE.

After reading the comments, I realized that most people don't know that it is possible to display private contributions on your public GitHub profile. Even better, it is possible to merge contributions made with different emails; if your company doesn't allow using your personal GitHub account, for example.

I'm not going into the discussion about the original post, although I agree with Ryan and people commenting that GitHub contributions is a vanity metric and doesn't tell anything about someone being senior. But you can certainly have a chart full of green squares, even if you didn't work on side projects.

How to display private commits on your chart?

This is a screenshot of my public profile. Notice how it displays contributions to private repositories, and even though I was already removed from that organization, my contributions still show up in the chart.

The image is a screenshot of a GitHub user's contribution graph and activity overview for the year 2023. The contribution graph shows a consistent pattern of green squares indicating daily contributions, with more intense colors representing more activity. The sidebar indicates a total of 3,123 contributions for the year, with various filters and years listed above. Below the graph, an activity overview displays a pie chart with a breakdown of activities: 69% commits, 29% code reviews, and 2% pull requests. It also lists contributions to specific repositories such as "Real-Life-IaC/cdk-constructs" and "andresionek91/supletivo-data-...". There are entries for contribution activity, detailing commits, pull requests, and contributions to private repositories for December 2023 and contributions to private repositories for November 2023.
My public profile shows contributions to private repositories of different organizations, even though I left them a long time ago.

To activate it is quite simple. Go to you profile page, click on Contribution Settings and then activate the Private contributions. Check the official GitHub docs here.

The image displays a portion of a GitHub page showing the 'Contribution settings' dropdown menu with two options: 'Private contributions' and 'Activity overview.' Both options are currently checked. The 'Private contributions' option is highlighted with a tooltip stating, "Turning off private contributions will show only public activity on your profile." The 'Activity overview' option has a tooltip saying, "Turning off the activity overview will hide the section on your profile." To the right, the year 2024 is selected, indicating that the settings being viewed are for that year. Below the dropdown, part of a contribution graph can be seen, along with tabs for additional years ranging from 2023 to 2019.
Click on Contribution Settings and then Private contributions to display them in the chart.

Merge multiple GitHub accounts

But there is another problem. Many companies don't allow using your personal GitHub account at work, and they require you to create a new profile with your company email. The result is that your contributions end up scattered across many profiles. However, there is a solution for that, although it's not perfect. Let's look at my profile.

The image shows a GitHub contribution graph for the year 2022, with a total of 1,179 contributions. The graph displays contributions throughout the weekdays of each month, represented by squares that vary in shade of green—the darker the shade, the more contributions made on that day. There appears to be a consistent level of activity, with some peaks and valleys. Lighter greens are scattered throughout, with some darker greens suggesting more intense periods of activity. At the bottom left of the graph, there is a link with the text "Learn how we count contributions," and at the bottom right, a legend indicates the color scale from 'Less' to 'More' contributions.
Company Profile: asionek - using the company's email | I used this profile from Mar/22 to Aug/22 to commit to the organization's repos.
The image displays a GitHub contribution graph for the year 2022, showing a total of 1,242 contributions. The graph has a dark background and uses squares to represent the days of the week, with varying shades of green indicating the level of contribution activity: darker greens represent more contributions. The activity seems to be quite consistent, with a noticeable amount of contributions throughout the entire year. Above the graph, months from January to December are labeled, and below is a link stating "Learn how we count contributions." To the upper right, there is a dropdown menu labeled "Contribution settings," and at the lower right, there's a legend indicating the scale from "Less" to "More" contributions.
Personal Profile: andresionek91 | After Aug/22 the company allowed using the personal profile to commit to the org's private repos. Note how MOST of the contributions were move over from one profile to another.

I was able to import MOST contributions from asionek to andresionek91 between Mar/22 and Aug/22. If I hadn't been able to merge both profiles contributions, I would have an empty gap on my personal profile from Mar/22 to Aug/22. Here is how you do it:

  1. Go to your GitHub profile, click on the picture on the top right and then Settings.
  2. On the left menu, click on Emails. Then add your other email address (the company's email) that you use to commit.
  3. Verify the email and you're done!

The image shows a GitHub settings page for user Andre Sionek (andresionek91). The 'Emails' section is visible, listing three different email addresses associated with the account. The first is an "@gmail.com" address, marked for visibility in emails and for receiving notifications. The second is a ".co" domain email, also set to be visible in emails. The third, an "@.com" address, is marked as 'Primary', and is noted to be used for account-related notifications and password resets, as well as being visible in emails. There is also an option to add another email address. On the left, a navigation menu includes options like Public profile, Account, Appearance, Accessibility, Notifications, and other settings categories. On the top right, there's a button to go to the personal profile.
Add the other emails you use to commit to your personal profile. This allows updating your personal contribution chart with commits made using other emails.

Rules for counting contributions

There are a few rules that are considered when counting contributions. You can find the rules on the GitHub documentation. They are:

Commits will appear on your contributions graph if they meet ALL 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: 1. In the repository's default branch; 2. In the gh-pages branch (for repositories with project sites).

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.


You might see that I mentioned that MOST of my contributions were moved over. This is because issues, PRs and discussions are not attributed when you merge the accounts.

If you merged multiple personal accounts, issues, pull requests, and discussions will not be attributed to the new account and will not appear on your contribution graph.

You can also read more about merging multiple personal accounts here.


GitHub Enterprise / Self-Hosted

If your company has a self-hosted instance of GitHub, they will need to enable GitHub Connect to allow sending contribution count to public profiles. Send this documentation page here to your SysAdmin, and ask them to allow this feature. If they deny, unfortunately there isn't anything else you can do to link the contributions to your personal profile.


What if I already left the company?

Unfortunately, you need to verify your email address to be able to merge your contributions in a single profile. The chances are that if you already left a company, you also don't have access to the email address to verify it.

Put that in the bucket of experience and merge your currently active GitHub accounts.

Muhammad Fahad

Frontend Developer | Meta & Google Certified | Skilled in React JS & Git/GitHub | Currently Learning Backend | Advancing in Full Stack | AI/Blockchain Enthusiast

6 个月

my github look like this, ??

  • 该图片无替代文字
回复
Md. Al-Amin Islam

Software Engineer || PhP - Laravel - MySQL - API - VueJS || LeetCode Problem Solver | Instructor at Youtube Channel |

6 个月

Very much helpful resource .

回复
Muhammad Ridho Anshory

Software Engineer (Frontend)

6 个月

I am reproduce the step you explained.. why im getting the email was already in use?

回复
Udhayarajan M

Developer @AffordMed

8 个月

Under "Merge multiple GitHub accounts" How can I add my work email to my account if there is already an account associated with that work email? Do I need to close my work account to do this?

回复
Abdinasir Muhumed

Software Engineer @ Hardin Design and Development | React, Flask. Omnia Vincit Veritas.

11 个月

It always surprises me when people look into such superficial things. One thing, outside of work, will never tell you everything or anything for that matter. Here is a simple contraction, if an engineer is working extremely hard to learn and grow and spends most of their time on their actual work. They will not have enough time or energy to update their GitHub every day. On the other hand, if the engineer is slacking off and barely doing anything, they will have the time to push something every day. So, by following the logic of only hiring people with full GitHub engagement, you will filter out the exact people you want, and end up with the exact opposite of the people you don’t want.

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了