diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2018-04-09 10:33:59 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-09 12:49:22 +0300 |
commit | 3f0b42bd074fcb49ae9b18522e6b2b8a27aa07b6 (patch) | |
tree | 1f394feca706d4a9faf5ed53299fe64a682acd38 /Documentation/git-worktree.txt | |
parent | b1801b85a32e21a7e83d165b029b5115ab0f8167 (diff) |
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>
Diffstat (limited to 'Documentation/git-worktree.txt')
-rw-r--r-- | Documentation/git-worktree.txt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index d322acbc67..be10da13ae 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. @@ -105,7 +106,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>:: @@ -277,8 +278,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 |