Skip to content
Latchkey

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 reasons

Options

FlagWhat it does
--porcelainStable, machine-readable output
-v / --verboseShow extra annotations (locked, prunable)
-zNUL-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

Run this faster and cheaper on Latchkey managed runners. Start free →