Keep calm and Git bisect

Ever saw your code break and don’t know when exactly the bug was introduced? Zvonimir Spajic walks us through git bisect to find the commit that broke things. I’ve used it myself quite a few times by now and it truly is really helpful in those situations. What I didn’t know however, is that it’s …

Speed up build times with this little Git trick

When building applications on build pipelines like GitHub Actions, Google Cloud Build, CircleCI, etc. every second counts. Here’s this small trick I use to speed up build times: when cloning the repo from its Git source, I instruct Git to do a shallow clone of the single branch it is building. 💡 If you’re running …

Understanding Git: Dispelling the magic of git merge

If you’ve ever wondered how Git internally manages commits and merges, Zvonimir Spajic (@konrad_126) has got you covered: Creating branches in git is blazingly fast and having a bunch of them is pretty cheap. This means we get to merge them quite often. But how is a branch represented internally and what does it mean …

The git pickaxe – Find commits that added/removed a specific string

On his blog, Philip Potter described something he calls “the git pickaxe”, a way to finding commits that contained a specific word. It uses git log‘s -S option to search for specific string: -S<string> Look for differences that change the number of occurrences of the specified string (i.e. addition/deletion) in a file. Intended for the …

Find the Commit that Broke the Tests with `git rebase –exec`

Nice tip by Kamran Ahmed: Find the commit that broke the tests $ git rebase -i –exec "yarn test" d294ae9 This will run "yarn test" on all the commits between d294ae9 and HEAD and stop on the commit where the tests fail — Kamran Ahmed (@kamranahmedse) February 2, 2020 If you want to go back …

GitLens – Git Supercharged Extension for Visual Studio Code

GitLens supercharges the Git capabilities built into Visual Studio Code. It helps you to visualize code authorship at a glance via Git blame annotations and code lens, seamlessly navigate and explore Git repositories, gain valuable insights via powerful comparison commands, and so much more. Just installed it and must say it’s really nice. Here’s an …