Tracking a Daily Coding Habit with the GitHub Contributions Graph

04 Mar 2022

I use the GitHub contributions graph to help sustain my new habit of writing code every day. If I push a change then it gets tracked for me. I like automated systems so this seemed perfect. It has been a month and my track record is pretty good. I seriously only missed a single day, and yes, it was planned. However, I have noticed that today’s changes are not marked off as a contribution?

GitHub Contribution Graph

You can see that I was pretty horrible at writing code during this past year. I am sure you have told yourself that you code a lot. I think we like delude ourselves like that sometimes. I am professional developer, so I do write code every day. Some days I could not tell what project it was for when mixed into work versus personal project code (the time spent writing code tends to blur the lines).

I needed a system. GitHub has a system. GitHub was not tracking my changes that I pushed on a branch. What?

It is clearly documented here that you need to push your changes to the main branch of a repository. If not pushed directly (shame on you) then a pull request will also trigger an update to the contribution graph.

Nice! I was using this graph to track my habit of writing code every day. Now I need a new strategy to keep track of blog posts and code I’ve been working on. I wake at 5AM and write code for at least 1/2 hour. That is the goal. It is generally longer than that … thankfully. That is the habit I am working on. It has made tremendous progress on the amount of code I produce for sure. This is designed to be that way according to James Clear here and here.

So this post came to be. I pushed it to main so I don’t have to track it manually.

< back