Git Branching
Learn Git by watching it work. Type real commands — commit, branch, merge, rebase, cherry-pick — and see the commit graph animate. Work through the levels, or experiment in the sandbox.
Your repository
Goal
How to use
Type commands in the terminal (↑/↓ for history; separate several with ;). Click a command below to put it in the terminal. Commits are labelled C0, C1…; copies made by rebase, revert or cherry-pick get a prime (C2′). Faded commits are no longer reachable from any branch. After git clone, origin's graph appears beside yours and dashed origin/… labels show where it was at your last fetch.
Commits & branches
Moving around
Combining work
Remotes
Inspecting
Refs
HEADThe commit you're onmain^Parent of mainHEAD~33 commits backC5^2Second parent of a mergeorigin/mainWhere origin's main was at last fetchHEAD@{2}Where HEAD was 2 moves ago (reflog)main..featureCommits in feature but not mainC3A commit by id
Playground
undoUndo the last commandresetRestart the level / sandboxclearClear the terminalhelpList commands