Skip to content
masterclass Buddy

Git · Concept

Detached HEAD

Git worktree lets one repository have several working directories. Each worktree can check out a different branch or commit while sharing the repository's data.

Last updated

Syntax

git worktree add <path> [<commit-ish>]
git worktree list
git worktree remove <worktree>

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • git worktree add
  • git worktree list
  • git worktree lock
  • git worktree move
  • git worktree prune
  • git worktree remove
  • git worktree repair
  • detached HEAD

Source: Git - git-worktree Documentation. Checked 2026-11-03.