git worktree list: Usage, Options & Common CI Errors
git worktree list shows all working trees attached to the repository and what each has checked out.
When a job juggles several worktrees, list is how you discover what exists, where, and on which branch - with a stable --porcelain format for scripts.
What it does
git worktree list prints each linked working tree with its path, current HEAD, and checked-out branch, flagging bare, detached, locked, or prunable trees.
Common usage
Terminal
git worktree list
git worktree list --porcelain
git worktree list -v # show lock/prunable reasonsOptions
| Flag | What it does |
|---|---|
| --porcelain | Stable, machine-readable output |
| -v / --verbose | Show extra annotations (locked, prunable) |
| -z | NUL-terminate records (with --porcelain) |
Common errors in CI
A worktree whose directory was deleted manually still appears as "prunable" until you run git worktree prune; parse --porcelain (not the human format) so a stale entry does not break a script. The main worktree is always listed first.
Related guides
git worktree add: Usage, Options & Common CI Errorsgit worktree add checks out an extra working tree from the same repo. Reference for -b, --detach, --track, an…
git worktree remove: Usage, Options & Common CI Errorsgit worktree remove deletes a linked working tree and its admin files. Reference for --force, prune, and the…
git worktree: Usage, Options & Common CI Errorsgit worktree checks out multiple branches into separate directories from one repo. Reference for add, list, r…
git status: Usage, Options & Common CI Errorsgit status shows staged, unstaged, and untracked changes plus branch state. Reference for -s, --porcelain, -b…