From: Sam Bostock Date: Wed, 28 Jan 2026 05:39:45 +0000 (+0000) Subject: worktree: clarify that --expire only affects missing worktrees X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f5ca70580444e61231ad33de0aac81d2420d523;p=thirdparty%2Fgit.git worktree: clarify that --expire only affects missing worktrees The --expire option for "git worktree list" and "git worktree prune" only affects worktrees whose working directory path no longer exists. The help text did not make this clear, and the documentation inconsistently used "unused" for prune but "missing" for list. Update the help text and documentation to consistently describe these as "missing worktrees", and use "prune" instead of "expire" when describing the effect on missing worktrees since the terminology is clearer. While at it, expand the description of the "prune" subcommand itself to better explain what it does and when to use it, as suggested by Junio. Helped-by: Eric Sunshine Helped-by: Junio C Hamano Signed-off-by: Sam Bostock Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-worktree.adoc b/Documentation/git-worktree.adoc index f272f79783..22ef37ec02 100644 --- a/Documentation/git-worktree.adoc +++ b/Documentation/git-worktree.adoc @@ -131,7 +131,13 @@ with linked worktrees if you move the main worktree manually.) `prune`:: -Prune worktree information in `$GIT_DIR/worktrees`. +Remove worktree information in `$GIT_DIR/worktrees` for worktrees +whose working trees are missing. Useful after manually removing +a working tree that is no longer needed (but use "git worktree +remove" next time you want to do so). Also, if you _moved_ a +working tree elsewhere causing the worktree information to become +dangling, see "git worktree repair" to reconnect the worktree to +the new working tree location. `remove`:: @@ -271,7 +277,7 @@ mismatch, even if the links are correct. With `list`, output additional information about worktrees (see below). `--expire