Skip to content

Git worktree

← All terms · Git fundamentals

Also called Worktree

A feature allowing you to have multiple working directories attached to a single Git repository, meaning you can check out multiple branches simultaneously.

What it is

A worktree lets you clone a repository once, but open several different branches in entirely separate folders on your computer. This isolates your environments so you can run a heavy local server on one branch while writing code in another without constantly stashing and switching context.

When you would use it

You use worktrees when you need to frequently jump between two drastically different branches and the cost of switching (like rebuilding dependencies or restarting servers) is too high.

Common operations

  • Running a long test suite on one branch while coding on another.
  • Keeping a stable production branch running in one folder while actively developing a feature branch in another.

Related terms

Where this is taught

No learning path uses this term yet. Browse the Learning Atlas for guided sequences through related ideas.