When Github Statistics first came out, I instantly fell in love. You know, the green graph on your profile that tells you how many days in a row you’ve committed code?

First of all, it’s really fun to see your stats, and once you have a streak going, you just can’t break it!

However, the thing that really excited me were the implications for job seekers, especially those just starting to code and building up their portfolio. Your Github profile is increasingly becoming your resume, and these stats are a good way for employers to see your commitment and hard work very quickly, or so I thought.

One day, I happened to look at my Github stats in an incognito window, and noticed that my public stats were wildly different the stats I see when I’m logged in to Github. For one, my 26 day streak, which I worked very hard on, was reduced to 18 days!

Thinking it was a Github bug, I emailed support (no it’s not a bug, it’s a feature!). I also have since read some other people’s post about it, and here are things to keep in mind to keep your public Github stats up:

Private Contributions Aren’t Public

Here is what Github support wrote to me:

We take user security and privacy very seriously. Allowing unauthorized people to see that you have made commits on private repositories or that you have starred private repositories could be considered a security leak. That’s why your profile is different when you sign in vs. when you are not signed in.

When you sign in, we know that you have the authorization to see this additional information. That’s why you see the private repositories listed under “Repositories contributed to”, and why the starred count is 101 and not 99, and why your contribution graph shows more contributions.

When you aren’t signed in or when your profile page is visited by a random web surfer – we don’t know if this person has the authorization to know about these private repositories you are in contact with. As a result, we only show information regarding your activities on public repositories.

In short, everyone that has the authorization to see the private information will see it, but other users won’t.

Personally, I think the stats should still be public, but the private repos are just named “private contribution” when someone clicks on the green box to actually see the contribution. But hey, that’s just my opinion!

Anyway, keep this in mind. If, at work, you’re contributing every day to a private repo on github (not the self hosted enterprise solution), your intense streak will not be visible publicly. Make sure to have public side projects you’re contributing to on a regular basis.

The Tricks

Of course there are plenty of other Github gotchas, and I highly recommend reading Ryan Sey’s 177 Days on Github about his impressive 177 day streak (all public!). Here are the main tricks to keep in mind according to Ryan:

GitHub runs on PST, which meant I could contribute anywhere from 12am — 3am local time (EST) and have it count for the previous day. When I got home extra late a few nights, this trick had my back.

Filing an issue on any repo counts as a contribution. This saved me a few times I was short on code ideas.

Commits are separate from pushes. Commit now and push later and it will still count for whenever you commited.

Initial commits from newly created repos don’t count. But the second commit on that repo will make both commits count. This one is weird.

Pull requests count for 1 contribution when you make them and another contribution if they are merged. If they don’t get merged, sorry, no second contribution.