git-worktree.txt: recommend 'git worktree remove' over manual deletion
When cc73385cf6 (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 <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Sunshine committed
Apr 9, 2018 at 03:33 UTC
3f0b42bd074fcb49ae9b18522e6b2b8a27aa07b6
1 file changed
+7
-7
Documentation/git-worktree.txt
+7
-7
@@ -27,11 +27,12 @@ out more than one branch at a time. With `git worktree add` a new working
27
tree is associated with the repository. This new working tree is called a
28
"linked working tree" as opposed to the "main working tree" prepared by "git
29
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`.
32
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
36
`gc.worktreePruneExpire` in linkgit:git-config[1]), or you can run
37
`git worktree prune` in the main or any linked working tree to
38
clean up any stale administrative files.
@@ -105,7 +106,7 @@ OPTIONS
106
By default, `add` refuses to create a new working tree when
107
`<commit-ish>` is a branch name and is already checked out by
108
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.
110
111
-b <new-branch>::
112
-B <new-branch>::
@@ -277,8 +278,7 @@ $ pushd ../temp
278
# ... hack hack hack ...
279
$ git commit -a -m 'emergency fix for boss'
280
$ popd
280
-$ rm -rf ../temp
281
-$ git worktree prune
281
+$ git worktree remove ../temp
282
------------
283
284
BUGS