---
title: "Git Tangle: Learn Git Branching Game | Aback Games"
description: "Practise git commit, branch, merge, rebase, cherry-pick and reset in a browser terminal. Match the goal graph in 12 levels. Free, nothing to install."
url: https://abackgames.com/games/git-tangle
---

# Git Tangle

Learn git branching by doing it: type real git commands until your commit graph matches the goal. 12 levels, from commit to rebase.

- Developer game
- Free
- No sign-up
- Keyboard
- Touch

## About Git Tangle

Git is easy to use and hard to picture. Most people learn a handful of commands by heart and hope nothing goes wrong. Git Tangle shows you what each command does to the commit graph, so branches, merges and rebases stop being a mystery.

Each of the 12 levels shows your repository next to a goal. Type git commands in the terminal and watch your graph change. When the two match, the level is solved. The commands are the real ones, with the same names and options you use at work.

## How to play Git Tangle

1. Read the task and look at the two graphs: your repository on one side, the goal on the other.
2. Type a git command, such as git commit or git checkout -b feature, and press Enter. On a phone, tap a command chip to start typing it.
3. Your graph updates after each command. Keep going until it has the same shape as the goal.
4. Stuck? Open the hint, undo a command, reset the level or show a solution.

## Git Tangle controls

**Keyboard**

- **Run a command**: Type it and press Enter
- **Earlier commands**: Up and Down arrows in the terminal
- **Next level, once solved**: Enter on an empty line
- **Undo the last command**: Type undo, or press Undo
- **Sound on or off**: M (outside the terminal)

**Touch screens**

- **Start a command**: Tap a command chip, then finish typing
- **Run it**: Tap Run
- **Undo, reset or next level**: Tap the buttons under the terminal

## Git Tangle rules

### The commands

git commit, branch (with -d, -D and -f), checkout (with -b), switch (with -c and --detach), merge (with --no-ff and --ff-only), rebase, cherry-pick, reset (with --hard, --soft or --mixed), log and status. Refs work as in git: a branch name, a commit such as C2, or HEAD, followed by \~n to go back n commits or ^n for a merge’s nth parent.

There are no files, so nothing ever conflicts and --hard makes no difference. Interactive rebase, revert, stash and remotes are not part of these puzzles.

### Reading the graph

Each circle is a commit and each line joins a commit to its parent, older on the left. Branch names sit under the commit they point to; the filled name is the branch you are on, and HEAD marks the commit you are on. A dashed circle is a copy made by rebase or cherry-pick, labelled with a prime: C2′ is a copy of C2.

Commits that no branch can reach any more are not drawn, as if git had cleaned them up. You can still name them, as in git.

### When a level is solved

Your repository must have the same branches as the goal, each pointing at a commit in the same place. The level’s own commits must match exactly; commits you make with git commit, and copies, only need to be in the right places, so any sequence of commands that builds the same history counts. Which branch you finish on does not matter.

The fewest commands you used for each level is saved in this browser. If you show the solution first, that level is not recorded on this visit.

## Tips and strategy

- Before typing, find what differs between the two graphs: a missing commit, a branch in the wrong place or a line that should be straight.
- Check where HEAD is. Most commands work on the branch you are on, so git checkout or git switch first.
- Merge keeps history as it happened, with a merge commit where branches join. Rebase rewrites it into a straight line by copying commits.
- If the branch you are on has nothing of its own, git merge just moves it forward: a fast-forward, with no new commit.
- Use git log to see the commits behind HEAD, and undo freely: it costs nothing.

## Frequently asked questions

Is this real git?

It is a model of git’s commit graph that follows git’s rules for these commands. It runs entirely in your browser, with no repository or files, so you can experiment without breaking anything.

What is the difference between git merge and git rebase?

Merge joins two branches with a merge commit and keeps every commit where it was. Rebase copies your branch’s commits onto the tip of another branch, giving a straight history but new commits. Levels 4 and 9 let you try each.

What does detached HEAD mean?

HEAD normally points at a branch, and the branch moves when you commit. After checking out a commit directly, HEAD points at the commit itself, so new commits belong to no branch until you make one. Level 8 walks through it.

Do I need to install anything?

No. Git Tangle runs in your browser on desktop and mobile, with nothing to install and no account.

## Guides and tips

Developer skills

### [Git branching explained: commit, merge, rebase and reset](https://abackgames.com/guides/git-branching-explained)

What a branch actually is, what HEAD points to, and what merge, rebase, cherry-pick and reset do to the commit graph.

 4 min read

## More games like this

Developer

### [Bug Hunt](https://abackgames.com/games/bug-hunt)

Spot the buggy line in short JavaScript, Python and SQL snippets. 8 a round, with the cause and the fix after each.

- Keyboard
- Touch

Developer

### [Regex Runner](https://abackgames.com/games/regex-runner)

Write a regular expression that matches every string on one list and none on the other. 24 puzzles, from anchors to lookarounds.

- Keyboard
- Touch

Developer

### [Code Typer](https://abackgames.com/games/code-typer)

A typing test for programmers: type real JavaScript, Python, Rust and SQL code against the clock.

- Keyboard
- Touch

[ All games](https://abackgames.com/games)
