# [PATCH 1/2] git-worktree.txt: recommend 'git worktree remove' over manual deletion

3 messages from 2018-04-09 to 2018-04-09. Participants: Eric Sunshine, Duy Nguyen.
Thread: https://gitlist.dev/t/48246

## Eric Sunshine, 2018-04-09 07:33

Subject: [PATCH 1/2] git-worktree.txt: recommend 'git worktree remove' over manual deletion
Message-ID: <20180409073400.19415-1-sunshine@sunshineco.com>
URL: https://gitlist.dev/e/20180409073400.19415-1-sunshine%40sunshineco.com

```
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>
---
 Documentation/git-worktree.txt | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index e7eb24ab85..bc9cd8b60f 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -27,11 +27,12 @@ out more than one branch at a time.  With `git worktree add` a new working
 tree is associated with the repository.  This new working tree is called a
 "linked working tree" as opposed to the "main working tree" prepared by "git
 init" or "git clone".  A repository has one main working tree (if it's not a
-bare repository) and zero or more linked working trees.
+bare repository) and zero or more linked working trees. When you are done
+with a linked working tree, remove it with `git worktree remove`.
 
-When you are done with a linked working tree you can simply delete it.
-The working tree's administrative files in the repository (see
-"DETAILS" below) will eventually be removed automatically (see
+If a working tree is deleted without using `git worktree remove`, then
+its associated administrative files, which reside in the repository
+(see "DETAILS" below), will eventually be removed automatically (see
 `gc.worktreePruneExpire` in linkgit:git-config[1]), or you can run
 `git worktree prune` in the main or any linked working tree to
 clean up any stale administrative files.
@@ -106,7 +107,7 @@ OPTIONS
 	By default, `add` refuses to create a new working tree when
 	`<commit-ish>` is a branch name and is already checked out by
 	another working tree and `remove` refuses to remove an unclean
-	working tree. This option overrides that safeguard.
+	working tree. This option overrides these safeguards.
 
 -b <new-branch>::
 -B <new-branch>::
@@ -278,8 +279,7 @@ $ pushd ../temp
 # ... hack hack hack ...
 $ git commit -a -m 'emergency fix for boss'
 $ popd
-$ rm -rf ../temp
-$ git worktree prune
+$ git worktree remove ../temp
 ------------
 
 BUGS
-- 
2.17.0.484.g0c8726318c


```

## Eric Sunshine, 2018-04-09 07:34

Subject: [PATCH 2/2] git-worktree.txt: unify command-line prompt in example blocks
Message-ID: <20180409073400.19415-2-sunshine@sunshineco.com>
URL: https://gitlist.dev/e/20180409073400.19415-2-sunshine%40sunshineco.com
In-Reply-To: <20180409073400.19415-1-sunshine@sunshineco.com>

```
The command-line prompt in the "EXAMPLES" section is "$", however,
examples in the 'git worktree list' section (oddly) use "S" as a
prompt. Fix this inconsistency by settling on "$" as prompt in all
examples.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---
 Documentation/git-worktree.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index bc9cd8b60f..2755ca90e3 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -233,7 +233,7 @@ The worktree list command has two output formats.  The default format shows the
 details on a single line with columns.  For example:
 
 ------------
-S git worktree list
+$ git worktree list
 /path/to/bare-source            (bare)
 /path/to/linked-worktree        abcd1234 [master]
 /path/to/other-linked-worktree  1234abc  (detached HEAD)
@@ -248,7 +248,7 @@ if the value is true.  An empty line indicates the end of a worktree.  For
 example:
 
 ------------
-S git worktree list --porcelain
+$ git worktree list --porcelain
 worktree /path/to/bare-source
 bare
 
-- 
2.17.0.484.g0c8726318c


```

## Duy Nguyen, 2018-04-09 16:11

Subject: Re: [PATCH 1/2] git-worktree.txt: recommend 'git worktree remove' over manual deletion
Message-ID: <CACsJy8C+x__iEXU3LPTBRnoUBbcOXom6qO_42yk=eNS8_UddvQ@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8C%2Bx__iEXU3LPTBRnoUBbcOXom6qO_42yk%3DeNS8_UddvQ%40mail.gmail.com
In-Reply-To: <20180409073400.19415-1-sunshine@sunshineco.com>

```
On Mon, Apr 9, 2018 at 9:33 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> 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.

Too bad we can't show off "git worktree move" :) The patches look fine.
-- 
Duy

```
