@@ -27,11 +27,12 @@ out more than one branch at a time. With `git worktree add` a new working
27
27
tree is associated with the repository. This new working tree is called a
28
28
"linked working tree" as opposed to the "main working tree" prepared by "git
29
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`.
31
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
35
36
`gc.worktreePruneExpire` in linkgit:git-config[1]), or you can run
36
37
`git worktree prune` in the main or any linked working tree to
37
38
clean up any stale administrative files.
@@ -106,7 +107,7 @@ OPTIONS
106
107
By default, `add` refuses to create a new working tree when
107
108
`<commit-ish>` is a branch name and is already checked out by
108
109
another working tree and `remove` refuses to remove an unclean
109
- working tree. This option overrides that safeguard .
110
+ working tree. This option overrides these safeguards .
110
111
111
112
-b <new-branch>::
112
113
-B <new-branch>::
@@ -232,7 +233,7 @@ The worktree list command has two output formats. The default format shows the
232
233
details on a single line with columns. For example:
233
234
234
235
------------
235
- S git worktree list
236
+ $ git worktree list
236
237
/path/to/bare-source (bare)
237
238
/path/to/linked-worktree abcd1234 [master]
238
239
/path/to/other-linked-worktree 1234abc (detached HEAD)
@@ -247,7 +248,7 @@ if the value is true. An empty line indicates the end of a worktree. For
247
248
example:
248
249
249
250
------------
250
- S git worktree list --porcelain
251
+ $ git worktree list --porcelain
251
252
worktree /path/to/bare-source
252
253
bare
253
254
@@ -278,8 +279,7 @@ $ pushd ../temp
278
279
# ... hack hack hack ...
279
280
$ git commit -a -m 'emergency fix for boss'
280
281
$ popd
281
- $ rm -rf ../temp
282
- $ git worktree prune
282
+ $ git worktree remove ../temp
283
283
------------
284
284
285
285
BUGS
0 commit comments