Skip to content

LearnGitBranching

An interactive browser game and sandbox that draws git commits as a tree so you can learn git visually.

Stars
34.2k
Forks
6k
Licence
MIT
Language
JavaScript
Last update
6 days ago
Type
Learning resource

What it is

LearnGitBranching is a web app that teaches git through levels and a sandbox. As you type git commands, it updates a diagram of the commit tree so you can see what each command does to your repository. It is meant to help people who find git hard to picture from the command line alone.

  • Type git commands in sandbox mode and watch the commit tree update after each one
  • Work through the levels to learn concepts such as branching and remote repositories
  • Use undo and reset to experiment without consequences
  • Share a link that runs a set of commands on load using the command URL parameter
  • Build your own level with the build level command and share it as JSON or a gist

Great for

  • Beginners who want to see what git commands do to commits and branches
  • Developers who want to fill gaps in branching, rebasing, or remote workflows
  • Instructors demonstrating git concepts to a class or friend
  • People who enjoy challenge-style learning with a command count they can try to minimize

Not ideal for

  • People who need a real git client for daily work, since this is a tutorial and sandbox rather than a tool for managing your own repositories
  • Anyone looking for a full reference manual of every git command, because the README describes it as a game with levels rather than documentation
Step-by-step guide: how to use LearnGitBranchingInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Use it in the browser (or self-host)

    Clone the repository

    git clone https://github.com/pcottle/learnGitBranching
  2. 2

    Run it

    • Open https://pcottle.github.io/learnGitBranching/ in your browser
    • Try a quick demo at https://pcottle.github.io/learnGitBranching/?demo
    • Type git commands into the input to see the commit tree update
    • Type levels to see the available lessons and which ones you have solved
  3. 3

    Get the most out of it

    • Use undo to reverse the last command and reset to start over, including inside levels
    • Try git golf by trying to solve each level with as few commands as possible
    • Use the command URL parameter with NODEMO to share a prepared sequence of commands
    • Run debug_copyTree() in the JS console to capture a state when reporting a bug
    • Use the build level command to create and share your own level

Downloads

Strengths

  • Visualizes the commit tree as commands run, which the README says is absent on the command line
  • Runs entirely in the browser with no backend or account, per the README
  • Open source under the MIT license

Trade-offs

  • The README does not describe a full list of supported git commands, so coverage of specific commands is unclear
  • Its focus is teaching rather than real repository work
  • Repository has no topics or releases listed, so version history is not visible from metadata

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.