Fill these in once
- Show every branch as a graph
git log --oneline --graph --allEach line is one commit with its short ID. The lines and stars on the left show where branches split and joined. Press q to leave.
- Show only the last 20 commits
git log --oneline --graph --all -20 - Show the graph for one branch
git log --oneline --graph main - Save it as a short command
git config --global alias.tree "log --oneline --graph --all"From now on git tree shows the same graph in any repository.
Check it worked
- Check the short command works
git tree -10
Undo it
- Remove the short command
git config --global --unset alias.tree
- Show every branch as a graph
git log --oneline --graph --allEach line is one commit with its short ID. The lines and stars on the left show where branches split and joined. Press q to leave.
- Show only the last 20 commits
git log --oneline --graph --all -20 - Show the graph for one branch
git log --oneline --graph main - Save it as a short command
git config --global alias.tree "log --oneline --graph --all"From now on git tree shows the same graph in any repository.
Check it worked
- Check the short command works
git tree -10
Undo it
- Remove the short command
git config --global --unset alias.tree
- Show every branch as a graph
git log --oneline --graph --allEach line is one commit with its short ID. The lines and stars on the left show where branches split and joined. Press q to leave.
- Show only the last 20 commits
git log --oneline --graph --all -20 - Show the graph for one branch
git log --oneline --graph main - Save it as a short command
git config --global alias.tree "log --oneline --graph --all"From now on git tree shows the same graph in any repository.
Check it worked
- Check the short command works
git tree -10
Undo it
- Remove the short command
git config --global --unset alias.tree

New to branch? I explain it in plain English on Layman Terms.