summaryrefslogtreecommitdiffstats
path: root/git-worktree.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-06-23 13:26:29 -0700
committerJunio C Hamano <gitster@pobox.com>2023-06-23 13:26:29 -0700
commit9469c13db24e0edec73595887cf74f38efd89a55 (patch)
tree269e9e6ab7f3dc3a8481c537a8e49f018f6361c2 /git-worktree.html
parenta7b2c10835189668841231edffc77e7dbb020487 (diff)
downloadgit-htmldocs-9469c13db24e0edec73595887cf74f38efd89a55.tar.gz
Autogenerated HTML docs for v2.41.0-191-g6ff334
Diffstat (limited to 'git-worktree.html')
-rw-r--r--git-worktree.html22
1 files changed, 20 insertions, 2 deletions
diff --git a/git-worktree.html b/git-worktree.html
index 665388379..8f05cc8b6 100644
--- a/git-worktree.html
+++ b/git-worktree.html
@@ -750,7 +750,7 @@ git-worktree(1) Manual Page
<div class="sectionbody">
<div class="verseblock">
<pre class="content"><em>git worktree add</em> [-f] [--detach] [--checkout] [--lock [--reason &lt;string&gt;]]
- [-b &lt;new-branch&gt;] &lt;path&gt; [&lt;commit-ish&gt;]
+ [--orphan] [(-b | -B) &lt;new-branch&gt;] &lt;path&gt; [&lt;commit-ish&gt;]
<em>git worktree list</em> [-v | --porcelain [-z]]
<em>git worktree lock</em> [--reason &lt;string&gt;] &lt;worktree&gt;
<em>git worktree move</em> &lt;worktree&gt; &lt;new-path&gt;
@@ -837,6 +837,15 @@ exist, a new branch based on <code>HEAD</code> is automatically created as if
<code>-b &lt;branch&gt;</code> was given. If <code>&lt;branch&gt;</code> does exist, it will be checked out
in the new worktree, if it&#8217;s not checked out anywhere else, otherwise the
command will refuse to create the worktree (unless <code>--force</code> is used).</p></div>
+<div class="paragraph"><p>If <code>&lt;commit-ish&gt;</code> is omitted, neither <code>--detach</code>, or <code>--orphan</code> is
+used, and there are no valid local branches (or remote branches if
+<code>--guess-remote</code> is specified) then, as a convenience, the new worktree is
+associated with a new orphan branch named <code>&lt;branch&gt;</code> (after
+<code>$(basename &lt;path&gt;)</code> if neither <code>-b</code> or <code>-B</code> is used) as if <code>--orphan</code> was
+passed to the command. In the event the repository has a remote and
+<code>--guess-remote</code> is used, but no remote or local branches exist, then the
+command fails with a warning reminding the user to fetch from their remote
+first (or override by using <code>-f/--force</code>).</p></div>
</dd>
<dt class="hdlist1">
list
@@ -1039,6 +1048,15 @@ To remove a locked worktree, specify <code>--force</code> twice.</p></div>
</p>
</dd>
<dt class="hdlist1">
+--orphan
+</dt>
+<dd>
+<p>
+ With <code>add</code>, make the new worktree and index empty, associating
+ the worktree with a new orphan/unborn branch named <code>&lt;new-branch&gt;</code>.
+</p>
+</dd>
+<dt class="hdlist1">
--porcelain
</dt>
<dd>
@@ -1380,7 +1398,7 @@ checkouts of a superproject.</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2022-10-28 11:53:56 PDT
+ 2023-06-23 13:24:09 PDT
</div>
</div>
</body>