Streaking With Github: Avoid These Mistakes

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?

Github Statistics

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:

  1. 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.
  2. Filing an issue on any repo counts as a contribution. This saved me a few times I was short on code ideas.
  3. Commits are separate from pushes. Commit now and push later and it will still count for whenever you commited.
  4. 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.
  5. 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.

You can also read more about this on Github FAQ.

Happy Streaking!

P.S. You can follow me on Github here.

Enjoy the article? Join over 14,500+ Swift developers and enthusiasts who get my weekly updates.

  • Arnaud Bertrand

    Hello Natasha.

    My streak has been broken due to commit to a non-default branch. This is tricky, only commits to default branch are considered as contributions.

    https://github.com/blog/1360-introducing-contributions

    Ar.

    • Sorry to hear that!

      • Arnaud Bertrand

        And there is another trick, you can modify a README.md file.

  • Josh bedo

    just found out that you can’t see private contributions in public, them saying it’s a security risk sounds like a bunch of baloney to me. You can still show green activity but not link to commits or display the private repository. I really hope they change this as more employers use it to determine your skill level and how dedicated you are.

    • Steve

      I disagree. At large companies even which employee is commiting how much, and when is corporate information and I’d rather it be private. You can make fairly substantial inferences from it. Maybe what project is being prioritized or even when a project is finished because commits drop off, etc, etc.

      • Steve

        If it makes you feel better though I hire programmers and i couldn’t possibly care less how many commits you have in a row.

  • George

    I disagree that you should care about how long your streaks are. Here is a good article on why github is not your cv

    https://blog.jcoglan.com/2013/11/15/why-github-is-not-your-cv/

    If my link doesn’t appear, just google the phrase
    why github is not your cv

  • sindhus

    I have reported this flaw to Github but I think they havent changed their policy of one commit ID == one contribution. Rebasing and pushing commits will mean you contributed more than once with the same content.

  • Pingback: My 70-day streak on GitHub | Maximum Developer()

  • Steven

    I don’t think the length of the streak is important. Depends on the culture, some people have a life. Work 365 days are not necessary more productive.
    In addition, people can write a dummy script to cheat!

  • Pingback: What I learnt doing 100 days of Github commits.. | The Fleeting Dev()

  • This article can’t be serious? Oh my god, I believe it is. God (speaking as an atheist – can’t think of anything else to call upon) help us all. The brain-washing of the children is super successful.

  • Hacked, 504 days..
    https://github.com/ovr

  • John F. Mercer

    I use the “current streak” statistic for an entirely different purpose: if my streak is too long, that means I need to take a break & spend time away from the computer. Often, “Current Streak: 90 days” === burnout.

  • Keith Gilbertson

    Natasha, I was looking for something else and stumbled into this update today: https://github.com/blog/2173-more-contributions-on-your-profile

  • Sandra Grillon

    Hi, here’s the link “Ryan Sey’s 177 Days on Github” : https://ryanseys.com/post/177-days-of-github