summaryrefslogtreecommitdiffstats
path: root/git-worktree.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-09-18 18:16:46 -0700
committerJunio C Hamano <gitster@pobox.com>2020-09-18 18:16:46 -0700
commit5093e585a82e361cce2270aafd5f1b6954353021 (patch)
treef4264203033f4fda039d811c779e66e1f89228e4 /git-worktree.html
parenta65d8e6d1bb62324eb42aa11f71b3d3a02fc8523 (diff)
downloadgit-htmldocs-5093e585a82e361cce2270aafd5f1b6954353021.tar.gz
Autogenerated HTML docs for v2.28.0-546-g385c1
Diffstat (limited to 'git-worktree.html')
-rw-r--r--git-worktree.html16
1 files changed, 15 insertions, 1 deletions
diff --git a/git-worktree.html b/git-worktree.html
index d91c79086..c8c7e4654 100644
--- a/git-worktree.html
+++ b/git-worktree.html
@@ -773,6 +773,17 @@ tree is associated with the repository. This new working tree is called a
A repository has one main working tree (if it&#8217;s not a
bare repository) and zero or more linked working trees. When you are done
with a linked working tree, remove it with <code>git worktree remove</code>.</p></div>
+<div class="paragraph"><p>In its simplest form, <code>git worktree add &lt;path&gt;</code> automatically creates a
+new branch whose name is the final component of <code>&lt;path&gt;</code>, which is
+convenient if you plan to work on a new topic. For instance, <code>git
+worktree add ../hotfix</code> creates new branch <code>hotfix</code> and checks it out at
+path <code>../hotfix</code>. To instead work on an existing branch in a new working
+tree, use <code>git worktree add &lt;path&gt; &lt;branch&gt;</code>. On the other hand, if you
+just plan to make some experimental changes or do testing without
+disturbing existing development, it is often convenient to create a
+<em>throwaway</em> working tree not associated with any branch. For instance,
+<code>git worktree add -d &lt;path&gt;</code> creates a new working tree with a detached
+<code>HEAD</code> at the same commit as the current branch.</p></div>
<div class="paragraph"><p>If a working tree is deleted without using <code>git worktree remove</code>, then
its associated administrative files, which reside in the repository
(see "DETAILS" below), will eventually be removed automatically (see
@@ -951,6 +962,9 @@ To remove a locked working tree, specify <code>--force</code> twice.</p></div>
</p>
</dd>
<dt class="hdlist1">
+-d
+</dt>
+<dt class="hdlist1">
--detach
</dt>
<dd>
@@ -1272,7 +1286,7 @@ checkouts of a superproject.</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2020-09-09 15:23:32 PDT
+ 2020-09-18 18:12:31 PDT
</div>
</div>
</body>