Skip to content

Commit 6b747fc

Browse files
committed
Merge branch 'es/worktree-docs'
Doc updates. * es/worktree-docs: git-worktree.txt: unify command-line prompt in example blocks git-worktree.txt: recommend 'git worktree remove' over manual deletion
2 parents 8b22d13 + 22d11a6 commit 6b747fc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Documentation/git-worktree.txt

Lines changed: 9 additions & 9 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.
@@ -106,7 +107,7 @@ OPTIONS
106107
By default, `add` refuses to create a new working tree when
107108
`<commit-ish>` is a branch name and is already checked out by
108109
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.
110111

111112
-b <new-branch>::
112113
-B <new-branch>::
@@ -232,7 +233,7 @@ The worktree list command has two output formats. The default format shows the
232233
details on a single line with columns. For example:
233234

234235
------------
235-
S git worktree list
236+
$ git worktree list
236237
/path/to/bare-source (bare)
237238
/path/to/linked-worktree abcd1234 [master]
238239
/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
247248
example:
248249

249250
------------
250-
S git worktree list --porcelain
251+
$ git worktree list --porcelain
251252
worktree /path/to/bare-source
252253
bare
253254

@@ -278,8 +279,7 @@ $ pushd ../temp
278279
# ... hack hack hack ...
279280
$ git commit -a -m 'emergency fix for boss'
280281
$ popd
281-
$ rm -rf ../temp
282-
$ git worktree prune
282+
$ git worktree remove ../temp
283283
------------
284284

285285
BUGS

0 commit comments

Comments
 (0)