Since September 2022, I am actively trying to have a GitHub streak - every day at least one new contribution. And yes, I totally agree with you, it is meaningless. But it has a meaning for me. I want to do it, and I want to keep it. Even if some days the contribution has little to no value - like just adding a new article I have recently read into one of my news lists.
I used this widget to display the number of days on my GitHub profile. It was great until it stopped working some time ago. Some API changes probably. Maybe it'll come back eventually. But I didn't want to wait. I found an alternative that works here and now.
Except it doesn't work the same way as the previous one and as the GitHub commit graph itself. It only counts "real" commits, it doesn't recognize code reviews.
And this pointed out a flaw in my beloved streak. One day, June 1st, 2024, I somehow forgot to actually commit something. I "only" did two reviews for my Dependabot updates. I didn't notice, because when I opened GitHub page, the day was green. But my streak suddenly dropped by more than half 🥹
I could have just let it go and accept the bitterness. But I didn't want to. The other day I did four commits! What if I just virtually travel back in time and alter one of them to fill in the gap? 💡
And so I did. And the timeline was fixed. And I can enjoy my 1236 and counting streak. End of the story.
But this wasn't meant to be just a confession. And I don't ask for redemption. The title says I don't regret it. Here I wanted to explain why not.
Because due to this "cheating", I learned to know Git better than before.
Git is one of those things you can adopt in a few minutes and then spend a lifetime trying to really understand it. Btw it took just 10 days to forge this backbone on modern development. Stories like that keep reminding me how mediocre I actually am.
To be able to change a year and half worth of my project Git history, I needed to understand how to work with git rebase command. How to find the correct commit and how to alter it via the interactive mode. The biggest Aha! moment was realizing that once you do this, you effectively erase the current history starting from the altered commit and you'll get a new one. The changes and messages remain the same (except what was changed), but all commits will become new with new hashes. I used git rebase before, but only to fix very recent issues. So I successfully overlooked this fact. Now I am smarter.
Another 🤯 thing I have learned is that when using GitHub, there are two commit dates - the original Author Date (marking the point of time when the commit was created) and Commit Date (changing when the commit gets edited - or rebased). I learned it the hard way after I force-pushed my changes to GitHub and suddenly 150 commits were "made" on 17th January 2026 😰
That unfortunate event directly leads into my third discovery of existence of git filter-branch command and (more modern) git filter-repo tool. Those can be called into action to do bulk updates over commits. And help undone lapses like mine. So no worries, after another trial-and-error session with Copilot, I managed to repair my flawed Git history, and you could never tell again.
And that concludes my story. If you already knew all the above, good for you. It took me like 8 years of working with Git to dig that deep. I guess one can go even deeper, but I will take a break for a while. If you have stories to share or questions to ask, feel free to express them in the comments below. And stay tuned for another Alois discovers trivial things article.
Disclaimer: You should be careful when tampering with your Git timeline and force-pushing something in the repository. If you have changes in other branches or even uncommitted in your local checkouts, you may get into trouble. If the team is bigger than just you, the troubles may be even bigger. I could afford to ignore those concerns as it was my private repo with no WIP. But this is not always the case.
Top comments (0)