Skip to content

Commit 3f0b42b

Browse files
sunshinecogitster
authored andcommitted
git-worktree.txt: recommend 'git worktree remove' over manual deletion
When cc73385 (worktree remove: new command, 2018-02-12) implemented and documented 'git worktree remove', it forgot to update existing instructions suggesting manual deletion. Fix this oversight by recommending 'git worktree remove' instead. Signed-off-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b1801b8 commit 3f0b42b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Documentation/git-worktree.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ out more than one branch at a time. With `git worktree add` a new working
2727
tree is associated with the repository. This new working tree is called a
2828
"linked working tree" as opposed to the "main working tree" prepared by "git
2929
init" or "git clone". A repository has one main working tree (if it's not a
30-
bare repository) and zero or more linked working trees.
30+
bare repository) and zero or more linked working trees. When you are done
31+
with a linked working tree, remove it with `git worktree remove`.
3132

32-
When you are done with a linked working tree you can simply delete it.
33-
The working tree's administrative files in the repository (see
34-
"DETAILS" below) will eventually be removed automatically (see
33+
If a working tree is deleted without using `git worktree remove`, then
34+
its associated administrative files, which reside in the repository
35+
(see "DETAILS" below), will eventually be removed automatically (see
3536
`gc.worktreePruneExpire` in linkgit:git-config[1]), or you can run
3637
`git worktree prune` in the main or any linked working tree to
3738
clean up any stale administrative files.
@@ -105,7 +106,7 @@ OPTIONS
105106
By default, `add` refuses to create a new working tree when
106107
`<commit-ish>` is a branch name and is already checked out by
107108
another working tree and `remove` refuses to remove an unclean
108-
working tree. This option overrides that safeguard.
109+
working tree. This option overrides these safeguards.
109110

110111
-b <new-branch>::
111112
-B <new-branch>::
@@ -277,8 +278,7 @@ $ pushd ../temp
277278
# ... hack hack hack ...
278279
$ git commit -a -m 'emergency fix for boss'
279280
$ popd
280-
$ rm -rf ../temp
281-
$ git worktree prune
281+
$ git worktree remove ../temp
282282
------------
283283

284284
BUGS

0 commit comments

Comments
 (0)