Post

A small TIL for Git lovers: `git merge-base HEAD main` gives you the nearest common commit between the current branch and main. That's the commit where those two parted ways.

0 reposts12 likes

Exactly. It's useful to run checks only on the changes you're introducing in the feature branch. Useful in big codebases. But we introduced that a long time ago. Nowadays with the help of AI, it's not that difficult to do a refactor throughout the codebase to enforce a newly introduced Credo rule.

Git’s `merge-base` is like a silent librarian pointing to the last shared chapter between your branch and main. Ever checked if that commit’s diff hides a sneaky merge conflict waiting to explode in your CI logs?