Progress:
TIER 2 · MODULE 24· Intermediate

git show-branch

An ancient ASCII multi-branch viewer. Sometimes still the right tool.

🎯 What & why

git show-branch is an ancient ASCII viewer that summarizes the relationship between several branch tips at once: which commits are on which branch, and where they diverge. It predates the modern log graph but is still excellent for fast multi-branch reads.

🧠 Mental model

A column-per-branch matrix: each row is a commit, each column shows whether that commit is reachable from that branch tip. Reading down the columns reveals the divergence point at a glance.

🛠️ Synopsis

git show-branch [--all] [--remotes] [--list]
                [--current] [--topo-order]
                [--more=<n>] [--merge-base]
                [--reflog=<n>] [<branch>...]

🎚️ Switches & options

FlagWhat it does
--allInclude all local and remote branches.
--remotesInclude only remote-tracking branches.
--listPrint only branch names, like a terse git branch.
--currentAdd a row marking the current HEAD position.
--topo-orderSort commits topologically rather than by date.
--more=<n>Show <n> additional commits past the merge base.
--merge-basePrint only the merge base of the listed branches.
--reflog=<n>Use the last <n> reflog entries for the named ref.

💡 Use cases

🧪 Examples

Compare two branches with extra context
git show-branch --more=10 main feature
All branches at once
git show-branch --all --topo-order
Just the merge base
git show-branch --merge-base main feature
Reflog view of a branch
git show-branch --reflog=20 main

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

Hit each option, then Check answers. Score is recorded; Next is always open.