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.

Interesting! So, if this runs checks on a feature branch, then <your-base-branch> would most often be 'main', right?

0 reposts0 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.