What commit did I branch off from? 0 ▲ Jamie Tanna 1 hour ago · Tech · hide · 0 comments Sometimes, you create a branch off another branch, do some work on it, and want to know what the original branch was pointing at. For instance, if you're looking to clean up your Git history, but don't want to rebase off origin/HEAD as you know there are some gnarly conflicts you may have to deal with, you want to know the last known "good" commit. I'd previously look down my commits, work out what the first commit was that didn't look like one of mine on this branch and refer to that SHA. Instead - via - we can use git merge-base to do this, i.e.: % git log --graph --oneline * 895aa796f (HEAD -> ci/dequeued, origin/ci/dequeued) ci: auto-label PRs that have been dequeued from the Merge Queue * c2785bc5a (upstream/main, upstream/HEAD, main) refactor(oxlint): scope custom JS rules via config overrides (#45266) % git merge-base HEAD main c2785bc5a48a423e0c59dcc95921e5a33097d762 No comments yet. Log in to reply on the Fediverse. Comments will appear here.