When two branches have drifted apart, git log makes me run a few commands to see how. git show-branch puts it in one small table.
Give it the branches you want to compare:
git show-branch main feature
The first lines, before the -- separator, list the branches, one column each. Below that is one line per commit, newest first. A + or * in a column means the commit is on that branch (the * marks the branch you have checked out). A - marks a merge commit. The list stops at the commit where the branches share history, so you see exactly what each side added since they split.
A few options I’d keep in mind:
git show-branch --more=3 main feature
git show-branch -a
--more=3 shows three more commits past the common ancestor for context, and -a includes remote-tracking branches.
A caveat: the column layout gets hard to read with more than a handful of branches, and the names with ~ and ^ in the output are relative to the branch tip. For a quick picture of a messy history, git log --graph --oneline is easier on the eyes. I’d reach for show-branch when the question is simply what is on one branch and not on the other.
Further reading: git-show-branch documentation