What is a Git worktree?

Definition

A Git worktree gives a repository more than one working directory without creating a separate full clone for each branch. Each worktree has its own checked-out files while sharing the repository's object database.

Worktrees are useful for parallel development because one task can stay isolated from another. Teams still need clear branch ownership and integration checks because separate directories do not prevent logical conflicts between changes.

ELI5

A Git worktree is another workspace connected to the same code history. It lets two branches have their own visible files at the same time.

For example, one agent can work in a feature worktree while another fixes a bug in a different worktree. Neither needs to replace the files that the other agent currently sees.

Is a Git worktree a full repository clone?

No. It has a separate working directory but shares the main repository's stored objects and metadata.

Do worktrees prevent every merge conflict?

No. They prevent direct workspace overwrites, but two branches can still make logically conflicting changes that must be resolved during integration.

  1. Greg Isenberg in an attention-blue top and Michael Shimeles in an off-white top on a black background beside the headline “BUILD A SOFTWARE FACTORY”.
Definition card for Git worktree: What is a Git worktree?

A Git worktree is an additional checked-out working directory linked to one repository, allowing separate branches to be edited side by side.