See your branches as a graph
One log command turns a wall of commit text into a readable branch map.
- Run
git log --oneline --graph --all. - Each commit is one line; the lines on the left show where branches split and merge.
- Add
--decorateon older git versions to show branch and tag names.
Tip: Save it as an alias: git config --global alias.tree "log --oneline --graph --all", then run git tree.
Try it now: Run it in any repo you have and find where your current branch split off.
Next crumbs
- 💻 Terminal & gitPark unfinished work with git stashNeed to switch branches but you're mid-change? Stash it, switch, and bring it back later.
- 💻 Terminal & gitFix your last commit with --amendForgot a file or made a typo in the message? Fold the fix into the commit you just made.
- 💻 Terminal & gitJump back with cd -Toggle between your last two directories, like Alt+Tab for folders.