Command Line

Find the commit that introduced a bug in your code: how to use git bisect in 7 steps

When I first heard about git bisect I thought it sounded scary and complicated, so I never looked for an opportunity to learn more about it and use it. That’s until last week when I ran into a bug in our master branch. I knew that the bug was not there two days before so I tested an earlier commit and confirmed that that older commit was a good one. Now, we had tens of commits in between. How to find out when exactly the bug was introduced? It would be impractical to check and test each individual commit.

TIL: docker commit

When I need to create a new custom Docker image, I usually start with a base image (alpine, debian, python, etc, depending on the project), running it in the interactive mode and install the tools and dependencies I will need. Once I get my container the way I want, I create a Dockerfile with all the commands I ran inside my container. It works, but I just learned that this might be unnecessary extra work.

Command line shortcuts

I normally don’t use many shortcuts because it’s easier to just use my arrows and mouse to navigate than to memorize shortcuts but I am slowly realizing that the time spent on learning a new shortcut pays off.

Newer Posts