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 […]

Ahh shhgit! – Find leaked secrets in real time across GitHub, GitLab and BitBucket

Software developers can accidentally leak sensitive information, particularly secret keys for third party services, across code hosting platforms such as GitHub, GitLab and BitBucket. These secrets β€” including the data they were protecting β€” end up in the hands of bad actors which ultimately leads to significant data breaches. Imagine being able to monitor the […]

Squash all Git commits with git squash-all

Freek just shared his workflow to squash all git commits into one single commit β€” Handy for when you’re pushing a first public release of a project. His process involves removing the .git folder and starting off fresh again with a git init. Wondering if there are handier/shorter ways to achieve this I set off […]