How to keep a GitHub streak going without gaming it
A GitHub streak is the number of days in a row with at least one contribution on your calendar. Miss a whole day and it resets to zero. The honest way to keep one is to make a small habit of real work each day, not to push empty commits just to turn a square green.
I had to decide what a streak actually is when I built the streak card in Git Racer, and it turned out to be a smaller idea than people treat it. It is a count of consecutive days that have at least one contribution on your calendar. That's the whole definition, and the rest of this post is about the edges of it.
What counts toward a streak
A streak is built from your contribution calendar, so anything that lands there can keep it alive. GitHub's docs list what counts as a contribution, and it is more than commits: opened issues, pull requests and reviews count too. I went through the details in how GitHub counts contributions.
That helps with streaks. A day spent reviewing a teammate's pull request is a real day of work, and it can keep the chain going even when you didn't push code.
How Git Racer works out your streak
Git Racer stores one number per day from your contribution calendar, then walks backwards from today:
- If today has at least 1 contribution, it starts counting from today.
- If today is still empty, it starts from yesterday, so your streak doesn't show as broken at 9am before you've done anything.
- It keeps stepping back one day at a time and stops at the first day with 0.
The longest streak is the longest run of days with at least 1 contribution anywhere in the data it has stored for you. Both numbers show on your dashboard streak card and on the embeddable README badge in a README.
One honest caveat: the day boundary depends on time zones. A contribution lands on a day according to GitHub's rules, and Git Racer counts "today" in your time zone when it knows it, and in UTC otherwise. So a late-night commit can sit on a different day than you expected.
What breaks a streak
- A whole calendar day with 0 contributions.
- A commit that never reaches the calendar (my post on how GitHub counts contributions covers why).
- A time zone surprise, where the work you did "before midnight" was recorded on the next day.
That second one is worth checking if your streak resets and you're sure you worked. The calendar is the source of truth, and if it doesn't show the square, neither will a streak.
Keeping it going without gaming it
You can keep a streak alive with a script that commits to a throwaway repo every day. I would rather not, and I don't think it's what you want either, because the number stops meaning anything the moment you know it's fake. What works better:
- Shrink the daily bar. Decide that one small thing counts: a doc fix, a test, a review. Low bars are easy to clear on bad days.
- Use the whole calendar. Reviews and issues count, so a day with no code can still be a day on the chain.
- Pick a time to do it. Doing it at the same point each day matters more than doing a lot.
- Plan for a miss. Everyone loses a streak eventually. Treat the next day as day 1 and carry on.
Why leagues reward goals, not totals
A streak only tells you whether you showed up. It doesn't say how much you did, and a long streak of single commits looks the same as a long streak of big days. Git Racer's weekly leagues cover the other half. Each tier has its own weekly goal: 10 contributions to leave bronze, 25 for silver, 50 for gold and 100 for platinum. Hit your goal and you climb, finish a week with 0 and you drop, and everyone in between stays where they are.
Because promotion depends on your own goal and not on out-committing everyone else, a beginner can climb past people who commit more. I wrote about the other side of this, racing someone head to head, in how to compare GitHub contributions with a friend.
FAQ
Does GitHub show my streak?
Your profile shows the contribution calendar. Git Racer reads that calendar and works out your current and longest streak from it, so the numbers follow the calendar's rules.
Do private contributions count?
They can appear on your calendar as a count if you choose to show them on your profile, and Git Racer measures everyone the way the public sees them.
Can I see my streak without signing up for anything?
The streak shows on the dashboard after you sign in with GitHub, which only asks for the read:user scope, so Git Racer has no access to your repositories.
Try it
Start a race on Git Racer and see your current streak next to a friend's. Who do you think will break first?
Start a race on Git Racer