Learn Git Branching
An interactive, browser-based Git tutorial by Peter Cottle that draws the commit graph as you type commands, so you can watch what branching, merging, rebasing, cherry-picking and working with remotes actually do. It suits anyone who uses a handful of Git commands and fears the rest, and builds the mental model that makes Git's behaviour predictable.
34k
GitHub · Sept 2026
6k
GitHub · Sept 2026
MIT
GitHub · Sept 2026
Free, runs in browser
GitHub README · Sept 2026
Platform
Other
Peter Cottle
3 to 4 hours
Beginner
Free
What it is
Learn Git Branching is a Git visualiser, sandbox and set of lessons in one web page. Every command you type animates a picture of the commit tree: commits appear, branch labels move, HEAD detaches, rebased commits are copied onto a new base. It runs entirely in your browser with no signup, and it is open source under the MIT licence, with about 34k GitHub stars as of September 2026. It has been translated into many languages.
It has two modes:
- Levels: type levels to open lessons grouped into "worlds". The main sequence covers commits, branches, merging, rebasing, moving around with HEAD and relative references, reversing changes with reset and revert, cherry-picking, interactive rebase and more advanced topics. A separate remote sequence covers clone, fetch, pull, push, tracking branches and diverging history.
- Sandbox: experiment freely with any sequence of commands, use undo or reset, and even simulate a remote.
Levels also track how many commands you used, compared with the reference solution, which adds a small puzzle element.
Why the visualisation is the whole point
Git's difficulty is almost entirely in the mental model. Once you can see that a branch is just a pointer to a commit and that a rebase replays commits onto a new base, most commands become obvious. Reading that sentence does not achieve it; watching it happen on a graph you are manipulating does.
Where to focus
- Rebase and interactive rebase, because they are the commands people avoid out of fear.
- The remote levels. Much of the confusion in real teams is about the relationship between your local branch, your remote-tracking branch and the actual remote. These levels explain it more clearly than most written guides.
- Relative refs (HEAD~2, main^), which make many everyday tasks faster.
How long it takes and how to use it
Working through the main and remote sequences takes a few focused sessions for most learners. Try each level before looking at the solution. Afterwards, repeat a few of the operations in a real repository on your machine, since the tool simulates Git rather than running it, and a few details differ.
Weak spots
It focuses on the commit graph. It does not teach the staging area, resolving merge conflicts, .gitignore, or everyday workflows like pull requests. Pair it with Pro Git or a practical Git course for those, and keep a recovery guide such as Oh Shit, Git bookmarked.
Common questions
Is it for complete beginners? Yes, the first levels start from zero, though knowing why version control exists helps.
Does it use real Git? No, it simulates Git's behaviour in JavaScript, which is why it can animate everything.
Best for: students and developers who use Git daily but do not really understand branches, rebasing or remotes.
Ready to start?
Opens on Peter Cottle in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.