diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-03-07 14:41:20 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-07 14:41:20 -0800 |
commit | c7a8d87b7ec3976798edbadec4c209e77b38c7c6 (patch) | |
tree | d30df2b09b23ba32c2ddd988c7caee9a4390761e | |
parent | 5f907e9e08462d0b15c8983fc31451755eb9cebe (diff) | |
download | git-htmldocs-c7a8d87b7ec3976798edbadec4c209e77b38c7c6.tar.gz |
Autogenerated HTML docs for v2.35.1-415-gc21629
-rw-r--r-- | RelNotes/2.36.0.txt | 21 | ||||
-rw-r--r-- | git-config.html | 9 | ||||
-rw-r--r-- | git-ls-files.html | 4 | ||||
-rw-r--r-- | git-ls-files.txt | 2 | ||||
-rw-r--r-- | git-worktree.html | 265 | ||||
-rw-r--r-- | git-worktree.txt | 268 | ||||
-rw-r--r-- | howto/coordinate-embargoed-releases.html | 2 | ||||
-rw-r--r-- | howto/keep-canonical-history-correct.html | 2 | ||||
-rw-r--r-- | howto/maintain-git.html | 2 | ||||
-rw-r--r-- | howto/new-command.html | 2 | ||||
-rw-r--r-- | howto/rebase-from-internal-branch.html | 2 | ||||
-rw-r--r-- | howto/rebuild-from-update-hook.html | 2 | ||||
-rw-r--r-- | howto/recover-corrupted-blob-object.html | 2 | ||||
-rw-r--r-- | howto/recover-corrupted-object-harder.html | 2 | ||||
-rw-r--r-- | howto/revert-a-faulty-merge.html | 2 | ||||
-rw-r--r-- | howto/revert-branch-rebase.html | 2 | ||||
-rw-r--r-- | howto/separating-topic-branches.html | 2 | ||||
-rw-r--r-- | howto/setup-git-server-over-http.html | 2 | ||||
-rw-r--r-- | howto/update-hook-example.html | 2 | ||||
-rw-r--r-- | howto/use-git-daemon.html | 2 | ||||
-rw-r--r-- | howto/using-merge-subtree.html | 2 | ||||
-rw-r--r-- | howto/using-signed-tag-in-pull-request.html | 2 |
22 files changed, 315 insertions, 286 deletions
diff --git a/RelNotes/2.36.0.txt b/RelNotes/2.36.0.txt index de1e11e25..dcb39fe56 100644 --- a/RelNotes/2.36.0.txt +++ b/RelNotes/2.36.0.txt @@ -40,6 +40,18 @@ UI, Workflows & Features * "git branch" learned the "--recurse-submodules" option. + * A not-so-common mistake is to write a script to feed "git bisect + run" without making it executable, in which case all tests will + exit with 126 or 127 error codes, even on revisions that are marked + as good. Try to recognize this situation and stop iteration early. + + * When "index-pack" dies due to incoming data exceeding the maximum + allowed input size, include the value of the limit in the error + message. + + * The error message given by "git switch HEAD~4" has been clarified + to suggest the "--detach" option that is required. + Performance, Internal Implementation, Development Support etc. @@ -73,6 +85,11 @@ Performance, Internal Implementation, Development Support etc. paths were unnecessarily confusing since it did not differentiate inner merges and outer merges. + * Small modernization of the rerere-train script (in contrib/). + + * Use designated initializers we started using in mid 2017 in more + parts of the codebase that are relatively quiescent. + Fixes since v2.35 ----------------- @@ -232,6 +249,10 @@ Fixes since v2.35 * Document Taylor as a new member of Git PLC at SFC. Welcome. (merge e8d56ca863 tb/coc-plc-update later to maint). + * "git checkout -b branch/with/multi/level/name && git stash" only + recorded the last level component of the branch name, which has + been corrected. + * Other code cleanup, docfix, build fix, etc. (merge cfc5cf428b jc/find-header later to maint). (merge 40e7cfdd46 jh/p4-fix-use-of-process-error-exception later to maint). diff --git a/git-config.html b/git-config.html index a9c568459..a79eb8dcb 100644 --- a/git-config.html +++ b/git-config.html @@ -2121,6 +2121,15 @@ detachedHead </p>
</dd>
<dt class="hdlist1">
+suggestDetachingHead
+</dt>
+<dd>
+<p>
+ Advice shown when <a href="git-switch.html">git-switch(1)</a> refuses to detach HEAD
+ without the explicit <code>--detach</code> option.
+</p>
+</dd>
+<dt class="hdlist1">
checkoutAmbiguousRemoteBranchName
</dt>
<dd>
diff --git a/git-ls-files.html b/git-ls-files.html index ef8dff104..d219c0bee 100644 --- a/git-ls-files.html +++ b/git-ls-files.html @@ -1086,7 +1086,7 @@ other <dd>
<p>
Recursively calls ls-files on each active submodule in the repository.
- Currently there is only support for the --cached mode.
+ Currently there is only support for the --cached and --stage modes.
</p>
</dd>
<dt class="hdlist1">
@@ -1241,7 +1241,7 @@ pattern file appears in.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-01-10 13:33:11 PST
+ 2022-03-07 14:39:03 PST
</div>
</div>
</body>
diff --git a/git-ls-files.txt b/git-ls-files.txt index 48cc7c0b6..0dabf3f0d 100644 --- a/git-ls-files.txt +++ b/git-ls-files.txt @@ -156,7 +156,7 @@ a space) at the start of each line: --recurse-submodules:: Recursively calls ls-files on each active submodule in the repository. - Currently there is only support for the --cached mode. + Currently there is only support for the --cached and --stage modes. --abbrev[=<n>]:: Instead of showing the full 40-byte hexadecimal object diff --git a/git-worktree.html b/git-worktree.html index 96de76e17..3680e90f1 100644 --- a/git-worktree.html +++ b/git-worktree.html @@ -767,33 +767,36 @@ git-worktree(1) Manual Page <div class="paragraph"><p>Manage multiple working trees attached to the same repository.</p></div>
<div class="paragraph"><p>A git repository can support multiple working trees, allowing you to check
out more than one branch at a time. With <code>git worktree add</code> 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
-<a href="git-init.html">git-init(1)</a> or <a href="git-clone.html">git-clone(1)</a>.
-A repository has one main working tree (if it’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>
+tree is associated with the repository, along with additional metadata
+that differentiates that working tree from others in the same repository.
+The working tree, along with this metadata, is called a "worktree".</p></div>
+<div class="paragraph"><p>This new worktree is called a "linked worktree" as opposed to the "main
+worktree" prepared by <a href="git-init.html">git-init(1)</a> or <a href="git-clone.html">git-clone(1)</a>.
+A repository has one main worktree (if it’s not a bare repository) and
+zero or more linked worktrees. When you are done with a linked worktree,
+remove it with <code>git worktree remove</code>.</p></div>
<div class="paragraph"><p>In its simplest form, <code>git worktree add <path></code> automatically creates a
new branch whose name is the final component of <code><path></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 <path> <branch></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 <path></code> creates a new working tree with a detached
-<code>HEAD</code> at the same commit as the current branch.</p></div>
+path <code>../hotfix</code>. To instead work on an existing branch in a new worktree,
+use <code>git worktree add <path> <branch></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>
+worktree not associated with any branch. For instance,
+<code>git worktree add -d <path></code> creates a new worktree 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
<code>gc.worktreePruneExpire</code> in <a href="git-config.html">git-config(1)</a>), or you can run
-<code>git worktree prune</code> in the main or any linked working tree to
-clean up any stale administrative files.</p></div>
-<div class="paragraph"><p>If a linked working tree is stored on a portable device or network share
-which is not always mounted, you can prevent its administrative files from
-being pruned by issuing the <code>git worktree lock</code> command, optionally
-specifying <code>--reason</code> to explain why the working tree is locked.</p></div>
+<code>git worktree prune</code> in the main or any linked worktree to clean up any
+stale administrative files.</p></div>
+<div class="paragraph"><p>If the working tree for a linked worktree is stored on a portable device
+or network share which is not always mounted, you can prevent its
+administrative files from being pruned by issuing the <code>git worktree lock</code>
+command, optionally specifying <code>--reason</code> to explain why the worktree is
+locked.</p></div>
</div>
</div>
<div class="sect1">
@@ -805,10 +808,10 @@ add <path> [<commit-ish>] </dt>
<dd>
<p>
-Create <code><path></code> and checkout <code><commit-ish></code> into it. The new working directory
-is linked to the current repository, sharing everything except working
-directory specific files such as <code>HEAD</code>, <code>index</code>, etc. As a convenience,
-<code><commit-ish></code> may be a bare "<code>-</code>", which is synonymous with <code>@{-1}</code>.
+Create a worktree at <code><path></code> and checkout <code><commit-ish></code> into it. The new worktree
+is linked to the current repository, sharing everything except per-worktree
+files such as <code>HEAD</code>, <code>index</code>, etc. As a convenience, <code><commit-ish></code> may
+be a bare "<code>-</code>", which is synonymous with <code>@{-1}</code>.
</p>
<div class="paragraph"><p>If <code><commit-ish></code> is a branch name (call it <code><branch></code>) and is not found,
and neither <code>-b</code> nor <code>-B</code> nor <code>--detach</code> are used, but there does
@@ -827,25 +830,24 @@ branches from there if <code><branch></code> is ambiguous but exists on th <code>origin</code> remote. See also <code>checkout.defaultRemote</code> in
<a href="git-config.html">git-config(1)</a>.</p></div>
<div class="paragraph"><p>If <code><commit-ish></code> is omitted and neither <code>-b</code> nor <code>-B</code> nor <code>--detach</code> used,
-then, as a convenience, the new working tree is associated with a branch
-(call it <code><branch></code>) named after <code>$(basename <path>)</code>. If <code><branch></code>
-doesn’t exist, a new branch based on <code>HEAD</code> is automatically created as
-if <code>-b <branch></code> was given. If <code><branch></code> does exist, it will be
-checked out in the new working tree, if it’s not checked out anywhere
-else, otherwise the command will refuse to create the working tree (unless
-<code>--force</code> is used).</p></div>
+then, as a convenience, the new worktree is associated with a branch (call
+it <code><branch></code>) named after <code>$(basename <path>)</code>. If <code><branch></code> doesn’t
+exist, a new branch based on <code>HEAD</code> is automatically created as if
+<code>-b <branch></code> was given. If <code><branch></code> does exist, it will be checked out
+in the new worktree, if it’s not checked out anywhere else, otherwise the
+command will refuse to create the worktree (unless <code>--force</code> is used).</p></div>
</dd>
<dt class="hdlist1">
list
</dt>
<dd>
<p>
-List details of each working tree. The main working tree is listed first,
-followed by each of the linked working trees. The output details include
-whether the working tree is bare, the revision currently checked out, the
+List details of each worktree. The main worktree is listed first,
+followed by each of the linked worktrees. The output details include
+whether the worktree is bare, the revision currently checked out, the
branch currently checked out (or "detached HEAD" if none), "locked" if
-the worktree is locked, "prunable" if the worktree can be pruned by <code>prune</code>
-command.
+the worktree is locked, "prunable" if the worktree can be pruned by the
+<code>prune</code> command.
</p>
</dd>
<dt class="hdlist1">
@@ -853,11 +855,10 @@ lock </dt>
<dd>
<p>
-If a working tree is on a portable device or network share which
-is not always mounted, lock it to prevent its administrative
-files from being pruned automatically. This also prevents it from
-being moved or deleted. Optionally, specify a reason for the lock
-with <code>--reason</code>.
+If a worktree is on a portable device or network share which is not always
+mounted, lock it to prevent its administrative files from being pruned
+automatically. This also prevents it from being moved or deleted.
+Optionally, specify a reason for the lock with <code>--reason</code>.
</p>
</dd>
<dt class="hdlist1">
@@ -865,11 +866,10 @@ move </dt>
<dd>
<p>
-Move a working tree to a new location. Note that the main working tree
-or linked working trees containing submodules cannot be moved with this
-command. (The <code>git worktree repair</code> command, however, can reestablish
-the connection with linked working trees if you move the main working
-tree manually.)
+Move a worktree to a new location. Note that the main worktree or linked
+worktrees containing submodules cannot be moved with this command. (The
+<code>git worktree repair</code> command, however, can reestablish the connection
+with linked worktrees if you move the main worktree manually.)
</p>
</dd>
<dt class="hdlist1">
@@ -877,7 +877,7 @@ prune </dt>
<dd>
<p>
-Prune working tree information in <code>$GIT_DIR/worktrees</code>.
+Prune worktree information in <code>$GIT_DIR/worktrees</code>.
</p>
</dd>
<dt class="hdlist1">
@@ -885,10 +885,10 @@ remove </dt>
<dd>
<p>
-Remove a working tree. Only clean working trees (no untracked files
-and no modification in tracked files) can be removed. Unclean working
-trees or ones with submodules can be removed with <code>--force</code>. The main
-working tree cannot be removed.
+Remove a worktree. Only clean worktrees (no untracked files and no
+modification in tracked files) can be removed. Unclean worktrees or ones
+with submodules can be removed with <code>--force</code>. The main worktree cannot be
+removed.
</p>
</dd>
<dt class="hdlist1">
@@ -896,30 +896,30 @@ repair [<path>…] </dt>
<dd>
<p>
-Repair working tree administrative files, if possible, if they have
-become corrupted or outdated due to external factors.
+Repair worktree administrative files, if possible, if they have become
+corrupted or outdated due to external factors.
</p>
-<div class="paragraph"><p>For instance, if the main working tree (or bare repository) is moved,
-linked working trees will be unable to locate it. Running <code>repair</code> in
-the main working tree will reestablish the connection from linked
-working trees back to the main working tree.</p></div>
-<div class="paragraph"><p>Similarly, if a linked working tree is moved without using <code>git worktree
-move</code>, the main working tree (or bare repository) will be unable to
-locate it. Running <code>repair</code> within the recently-moved working tree will
-reestablish the connection. If multiple linked working trees are moved,
-running <code>repair</code> from any working tree with each tree’s new <code><path></code> as
-an argument, will reestablish the connection to all the specified paths.</p></div>
-<div class="paragraph"><p>If both the main working tree and linked working trees have been moved
-manually, then running <code>repair</code> in the main working tree and specifying the
-new <code><path></code> of each linked working tree will reestablish all connections
-in both directions.</p></div>
+<div class="paragraph"><p>For instance, if the main worktree (or bare repository) is moved, linked
+worktrees will be unable to locate it. Running <code>repair</code> in the main
+worktree will reestablish the connection from linked worktrees back to the
+main worktree.</p></div>
+<div class="paragraph"><p>Similarly, if the working tree for a linked worktree is moved without
+using <code>git worktree move</code>, the main worktree (or bare repository) will be
+unable to locate it. Running <code>repair</code> within the recently-moved worktree
+will reestablish the connection. If multiple linked worktrees are moved,
+running <code>repair</code> from any worktree with each tree’s new <code><path></code> as an
+argument, will reestablish the connection to all the specified paths.</p></div>
+<div class="paragraph"><p>If both the main worktree and linked worktrees have been moved manually,
+then running <code>repair</code> in the main worktree and specifying the new <code><path></code>
+of each linked worktree will reestablish all connections in both
+directions.</p></div>
</dd>
<dt class="hdlist1">
unlock
</dt>
<dd>
<p>
-Unlock a working tree, allowing it to be pruned, moved or deleted.
+Unlock a worktree, allowing it to be pruned, moved or deleted.
</p>
</dd>
</dl></div>
@@ -937,19 +937,19 @@ Unlock a working tree, allowing it to be pruned, moved or deleted. </dt>
<dd>
<p>
- By default, <code>add</code> refuses to create a new working tree when
+ By default, <code>add</code> refuses to create a new worktree when
<code><commit-ish></code> is a branch name and is already checked out by
- another working tree, or if <code><path></code> is already assigned to some
- working tree but is missing (for instance, if <code><path></code> was deleted
+ another worktree, or if <code><path></code> is already assigned to some
+ worktree but is missing (for instance, if <code><path></code> was deleted
manually). This option overrides these safeguards. To add a missing but
- locked working tree path, specify <code>--force</code> twice.
+ locked worktree path, specify <code>--force</code> twice.
</p>
-<div class="paragraph"><p><code>move</code> refuses to move a locked working tree unless <code>--force</code> is specified
-twice. If the destination is already assigned to some other working tree but is
+<div class="paragraph"><p><code>move</code> refuses to move a locked worktree unless <code>--force</code> is specified
+twice. If the destination is already assigned to some other worktree but is
missing (for instance, if <code><new-path></code> was deleted manually), then <code>--force</code>
allows the move to proceed; use <code>--force</code> twice if the destination is locked.</p></div>
-<div class="paragraph"><p><code>remove</code> refuses to remove an unclean working tree unless <code>--force</code> is used.
-To remove a locked working tree, specify <code>--force</code> twice.</p></div>
+<div class="paragraph"><p><code>remove</code> refuses to remove an unclean worktree unless <code>--force</code> is used.
+To remove a locked worktree, specify <code>--force</code> twice.</p></div>
</dd>
<dt class="hdlist1">
-b <new-branch>
@@ -960,7 +960,7 @@ To remove a locked working tree, specify <code>--force</code> twice.</p></div> <dd>
<p>
With <code>add</code>, create a new branch named <code><new-branch></code> starting at
- <code><commit-ish></code>, and check out <code><new-branch></code> into the new working tree.
+ <code><commit-ish></code>, and check out <code><new-branch></code> into the new worktree.
If <code><commit-ish></code> is omitted, it defaults to <code>HEAD</code>.
By default, <code>-b</code> refuses to create a new branch if it already
exists. <code>-B</code> overrides this safeguard, resetting <code><new-branch></code> to
@@ -975,7 +975,7 @@ To remove a locked working tree, specify <code>--force</code> twice.</p></div> </dt>
<dd>
<p>
- With <code>add</code>, detach <code>HEAD</code> in the new working tree. See "DETACHED HEAD"
+ With <code>add</code>, detach <code>HEAD</code> in the new worktree. See "DETACHED HEAD"
in <a href="git-checkout.html">git-checkout(1)</a>.
</p>
</dd>
@@ -1020,7 +1020,7 @@ To remove a locked working tree, specify <code>--force</code> twice.</p></div> </dt>
<dd>
<p>
- Keep the working tree locked after creation. This is the
+ Keep the worktree locked after creation. This is the
equivalent of <code>git worktree lock</code> after <code>git worktree add</code>,
but without a race condition.
</p>
@@ -1075,17 +1075,18 @@ To remove a locked working tree, specify <code>--force</code> twice.</p></div> </dt>
<dd>
<p>
- With <code>prune</code>, only expire unused working trees older than <code><time></code>.
+ With <code>prune</code>, only expire unused worktrees older than <code><time></code>.
</p>
-<div class="paragraph"><p>With <code>list</code>, annotate missing working trees as prunable if they are
-older than <code><time></code>.</p></div>
+<div class="paragraph"><p>With <code>list</code>, annotate missing worktrees as prunable if they are older than
+<code><time></code>.</p></div>
</dd>
<dt class="hdlist1">
--reason <string>
</dt>
<dd>
<p>
- With <code>lock</code> or with <code>add --lock</code>, an explanation why the working tree is locked.
+ With <code>lock</code> or with <code>add --lock</code>, an explanation why the worktree
+ is locked.
</p>
</dd>
<dt class="hdlist1">
@@ -1093,13 +1094,12 @@ older than <code><time></code>.</p></div> </dt>
<dd>
<p>
- Working trees can be identified by path, either relative or
- absolute.
+ Worktrees can be identified by path, either relative or absolute.
</p>
-<div class="paragraph"><p>If the last path components in the working tree’s path is unique among
-working trees, it can be used to identify a working tree. For example if
-you only have two working trees, at <code>/abc/def/ghi</code> and <code>/abc/def/ggg</code>,
-then <code>ghi</code> or <code>def/ghi</code> is enough to point to the former working tree.</p></div>
+<div class="paragraph"><p>If the last path components in the worktree’s path is unique among
+worktrees, it can be used to identify a worktree. For example if you only
+have two worktrees, at <code>/abc/def/ghi</code> and <code>/abc/def/ggg</code>, then <code>ghi</code> or
+<code>def/ghi</code> is enough to point to the former worktree.</p></div>
</dd>
</dl></div>
</div>
@@ -1107,21 +1107,20 @@ then <code>ghi</code> or <code>def/ghi</code> is enough to point to the former w <div class="sect1">
<h2 id="_refs">REFS</h2>
<div class="sectionbody">
-<div class="paragraph"><p>In multiple working trees, some refs may be shared between all working
-trees and some refs are local. One example is <code>HEAD</code> which is different for each
-working tree. This section is about the sharing rules and how to access
-refs of one working tree from another.</p></div>
-<div class="paragraph"><p>In general, all pseudo refs are per working tree and all refs starting
-with <code>refs/</code> are shared. Pseudo refs are ones like <code>HEAD</code> which are
-directly under <code>$GIT_DIR</code> instead of inside <code>$GIT_DIR/refs</code>. There are
-exceptions, however: refs inside <code>refs/bisect</code> and <code>refs/worktree</code> are not
-shared.</p></div>
-<div class="paragraph"><p>Refs that are per working tree can still be accessed from another
-working tree via two special paths, <code>main-worktree</code> and <code>worktrees</code>. The
-former gives access to per-working tree refs of the main working tree,
-while the latter to all linked working trees.</p></div>
+<div class="paragraph"><p>When using multiple worktrees, some refs are shared between all worktrees,
+but others are specific to an individual worktree. One example is <code>HEAD</code>,
+which is different for each worktree. This section is about the sharing
+rules and how to access refs of one worktree from another.</p></div>
+<div class="paragraph"><p>In general, all pseudo refs are per-worktree and all refs starting with
+<code>refs/</code> are shared. Pseudo refs are ones like <code>HEAD</code> which are directly
+under <code>$GIT_DIR</code> instead of inside <code>$GIT_DIR/refs</code>. There are exceptions,
+however: refs inside <code>refs/bisect</code> and <code>refs/worktree</code> are not shared.</p></div>
+<div class="paragraph"><p>Refs that are per-worktree can still be accessed from another worktree via
+two special paths, <code>main-worktree</code> and <code>worktrees</code>. The former gives
+access to per-worktree refs of the main worktree, while the latter to all
+linked worktrees.</p></div>
<div class="paragraph"><p>For example, <code>main-worktree/HEAD</code> or <code>main-worktree/refs/bisect/good</code>
-resolve to the same value as the main working tree’s <code>HEAD</code> and
+resolve to the same value as the main worktree’s <code>HEAD</code> and
<code>refs/bisect/good</code> respectively. Similarly, <code>worktrees/foo/HEAD</code> or
<code>worktrees/bar/refs/bisect/bad</code> are the same as
<code>$GIT_COMMON_DIR/worktrees/foo/HEAD</code> and
@@ -1134,12 +1133,12 @@ which will handle refs correctly.</p></div> <div class="sect1">
<h2 id="_configuration_file">CONFIGURATION FILE</h2>
<div class="sectionbody">
-<div class="paragraph"><p>By default, the repository <code>config</code> file is shared across all working
-trees. If the config variables <code>core.bare</code> or <code>core.worktree</code> are
-present in the common config file and <code>extensions.worktreeConfig</code> is
-disabled, then they will be applied to the main working tree only.</p></div>
-<div class="paragraph"><p>In order to have configuration specific to working trees, you can turn
-on the <code>worktreeConfig</code> extension, e.g.:</p></div>
+<div class="paragraph"><p>By default, the repository <code>config</code> file is shared across all worktrees.
+If the config variables <code>core.bare</code> or <code>core.worktree</code> are present in the
+common config file and <code>extensions.worktreeConfig</code> is disabled, then they
+will be applied to the main worktree only.</p></div>
+<div class="paragraph"><p>In order to have worktree-specific configuration, you can turn on the
+<code>worktreeConfig</code> extension, e.g.:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ git config extensions.worktreeConfig true</code></pre>
@@ -1150,9 +1149,9 @@ configuration in this file with <code>git config --worktree</code>. Older Git versions will refuse to access repositories with this extension.</p></div>
<div class="paragraph"><p>Note that in this file, the exception for <code>core.bare</code> and <code>core.worktree</code>
is gone. If they exist in <code>$GIT_DIR/config</code>, you must move
-them to the <code>config.worktree</code> of the main working tree. You may also
-take this opportunity to review and move other configuration that you
-do not want to share to all working trees:</p></div>
+them to the <code>config.worktree</code> of the main worktree. You may also take this
+opportunity to review and move other configuration that you do not want to
+share to all worktrees:</p></div>
<div class="ulist"><ul>
<li>
<p>
@@ -1166,8 +1165,8 @@ do not want to share to all working trees:</p></div> </li>
<li>
<p>
-<code>core.sparseCheckout</code> is recommended per working tree, unless you
- are sure you always use sparse checkout for all working trees.
+<code>core.sparseCheckout</code> should not be shared, unless you are sure you
+ always use sparse checkout for all worktrees.
</p>
</li>
</ul></div>
@@ -1178,34 +1177,34 @@ do not want to share to all working trees:</p></div> <div class="sect1">
<h2 id="_details">DETAILS</h2>
<div class="sectionbody">
-<div class="paragraph"><p>Each linked working tree has a private sub-directory in the repository’s
+<div class="paragraph"><p>Each linked worktree has a private sub-directory in the repository’s
<code>$GIT_DIR/worktrees</code> directory. The private sub-directory’s name is usually
-the base name of the linked working tree’s path, possibly appended with a
+the base name of the linked worktree’s path, possibly appended with a
number to make it unique. For example, when <code>$GIT_DIR=/path/main/.git</code> the
command <code>git worktree add /path/other/test-next next</code> creates the linked
-working tree in <code>/path/other/test-next</code> and also creates a
+worktree in <code>/path/other/test-next</code> and also creates a
<code>$GIT_DIR/worktrees/test-next</code> directory (or <code>$GIT_DIR/worktrees/test-next1</code>
if <code>test-next</code> is already taken).</p></div>
-<div class="paragraph"><p>Within a linked working tree, <code>$GIT_DIR</code> is set to point to this private
+<div class="paragraph"><p>Within a linked worktree, <code>$GIT_DIR</code> is set to point to this private
directory (e.g. <code>/path/main/.git/worktrees/test-next</code> in the example) and
-<code>$GIT_COMMON_DIR</code> is set to point back to the main working tree’s <code>$GIT_DIR</code>
+<code>$GIT_COMMON_DIR</code> is set to point back to the main worktree’s <code>$GIT_DIR</code>
(e.g. <code>/path/main/.git</code>). These settings are made in a <code>.git</code> file located at
-the top directory of the linked working tree.</p></div>
+the top directory of the linked worktree.</p></div>
<div class="paragraph"><p>Path resolution via <code>git rev-parse --git-path</code> uses either
<code>$GIT_DIR</code> or <code>$GIT_COMMON_DIR</code> depending on the path. For example, in the
-linked working tree <code>git rev-parse --git-path HEAD</code> returns
+linked worktree <code>git rev-parse --git-path HEAD</code> returns
<code>/path/main/.git/worktrees/test-next/HEAD</code> (not
<code>/path/other/test-next/.git/HEAD</code> or <code>/path/main/.git/HEAD</code>) while <code>git
rev-parse --git-path refs/heads/master</code> uses
<code>$GIT_COMMON_DIR</code> and returns <code>/path/main/.git/refs/heads/master</code>,
-since refs are shared across all working trees, except <code>refs/bisect</code> and
+since refs are shared across all worktrees, except <code>refs/bisect</code> and
<code>refs/worktree</code>.</p></div>
<div class="paragraph"><p>See <a href="gitrepository-layout.html">gitrepository-layout(5)</a> for more information. The rule of
thumb is do not make any assumption about whether a path belongs to
<code>$GIT_DIR</code> or <code>$GIT_COMMON_DIR</code> when you need to directly access something
inside <code>$GIT_DIR</code>. Use <code>git rev-parse --git-path</code> to get the final path.</p></div>
-<div class="paragraph"><p>If you manually move a linked working tree, you need to update the <code>gitdir</code> file
-in the entry’s directory. For example, if a linked working tree is moved
+<div class="paragraph"><p>If you manually move a linked worktree, you need to update the <code>gitdir</code> file
+in the entry’s directory. For example, if a linked worktree is moved
to <code>/newpath/test-next</code> and its <code>.git</code> file points to
<code>/path/main/.git/worktrees/test-next</code>, then update
<code>/path/main/.git/worktrees/test-next/gitdir</code> to reference <code>/newpath/test-next</code>
@@ -1213,10 +1212,10 @@ instead. Better yet, run <code>git worktree repair</code> to reestablish the con automatically.</p></div>
<div class="paragraph"><p>To prevent a <code>$GIT_DIR/worktrees</code> entry from being pruned (which
can be useful in some situations, such as when the
-entry’s working tree is stored on a portable device), use the
+entry’s worktree is stored on a portable device), use the
<code>git worktree lock</code> command, which adds a file named
<code>locked</code> to the entry’s directory. The file contains the reason in
-plain text. For example, if a linked working tree’s <code>.git</code> file points
+plain text. For example, if a linked worktree’s <code>.git</code> file points
to <code>/path/main/.git/worktrees/test-next</code> then a file named
<code>/path/main/.git/worktrees/test-next/locked</code> will prevent the
<code>test-next</code> entry from being pruned. See
@@ -1237,17 +1236,17 @@ details on a single line with columns. For example:</p></div> /path/to/linked-worktree abcd1234 [master]
/path/to/other-linked-worktree 1234abc (detached HEAD)</code></pre>
</div></div>
-<div class="paragraph"><p>The command also shows annotations for each working tree, according to its state.
+<div class="paragraph"><p>The command also shows annotations for each worktree, according to its state.
These annotations are:</p></div>
<div class="ulist"><ul>
<li>
<p>
-<code>locked</code>, if the working tree is locked.
+<code>locked</code>, if the worktree is locked.
</p>
</li>
<li>
<p>
-<code>prunable</code>, if the working tree can be pruned via <code>git worktree prune</code>.
+<code>prunable</code>, if the worktree can be pruned via <code>git worktree prune</code>.
</p>
</li>
</ul></div>
@@ -1267,13 +1266,13 @@ indented followed by the additional information.</p></div> /path/to/linked-worktree abcd1234 [master]
/path/to/locked-worktree-no-reason abcd5678 (detached HEAD) locked
/path/to/locked-worktree-with-reason 1234abcd (brancha)
- locked: working tree path is mounted on a portable device
+ locked: worktree path is mounted on a portable device
/path/to/prunable-worktree 5678abc1 (detached HEAD)
prunable: gitdir file points to non-existent location</code></pre>
</div></div>
<div class="paragraph"><p>Note that the annotation is moved to the next line if the additional
information is available, otherwise it stays on the same line as the
-working tree itself.</p></div>
+worktree itself.</p></div>
<div class="sect2">
<h3 id="_porcelain_format">Porcelain Format</h3>
<div class="paragraph"><p>The porcelain format has a line per attribute. Attributes are listed with a
@@ -1281,7 +1280,7 @@ label and value separated by a single space. Boolean attributes (like <code>bar and <code>detached</code>) are listed as a label only, and are present only
if the value is true. Some attributes (like <code>locked</code>) can be listed as a label
only or with a value depending upon whether a reason is available. The first
-attribute of a working tree is always <code>worktree</code>, an empty line indicates the
+attribute of a worktree is always <code>worktree</code>, an empty line indicates the
end of the record. For example:</p></div>
<div class="listingblock">
<div class="content">
@@ -1334,7 +1333,7 @@ demands that you fix something immediately. You might typically use <a href="git-stash.html">git-stash(1)</a> to store your changes away temporarily, however, your
working tree is in such a state of disarray (with new, moved, and removed
files, and other bits and pieces strewn around) that you don’t want to risk
-disturbing any of it. Instead, you create a temporary linked working tree to
+disturbing any of it. Instead, you create a temporary linked worktree to
make the emergency fix, remove it when done, and then resume your earlier
refactoring session.</p></div>
<div class="listingblock">
@@ -1367,7 +1366,7 @@ checkouts of a superproject.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:19:34 PST
+ 2022-03-07 14:39:03 PST
</div>
</div>
</body>
diff --git a/git-worktree.txt b/git-worktree.txt index b8d53c483..453e15502 100644 --- a/git-worktree.txt +++ b/git-worktree.txt @@ -25,45 +25,49 @@ Manage multiple working trees attached to the same repository. A git repository can support multiple working trees, allowing you to check 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 -linkgit:git-init[1] or linkgit:git-clone[1]. -A repository has one main working tree (if it's not a -bare repository) and zero or more linked working trees. When you are done -with a linked working tree, remove it with `git worktree remove`. +tree is associated with the repository, along with additional metadata +that differentiates that working tree from others in the same repository. +The working tree, along with this metadata, is called a "worktree". + +This new worktree is called a "linked worktree" as opposed to the "main +worktree" prepared by linkgit:git-init[1] or linkgit:git-clone[1]. +A repository has one main worktree (if it's not a bare repository) and +zero or more linked worktrees. When you are done with a linked worktree, +remove it with `git worktree remove`. In its simplest form, `git worktree add <path>` automatically creates a new branch whose name is the final component of `<path>`, which is convenient if you plan to work on a new topic. For instance, `git worktree add ../hotfix` creates new branch `hotfix` and checks it out at -path `../hotfix`. To instead work on an existing branch in a new working -tree, use `git worktree add <path> <branch>`. 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 -'throwaway' working tree not associated with any branch. For instance, -`git worktree add -d <path>` creates a new working tree with a detached -`HEAD` at the same commit as the current branch. +path `../hotfix`. To instead work on an existing branch in a new worktree, +use `git worktree add <path> <branch>`. 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 'throwaway' +worktree not associated with any branch. For instance, +`git worktree add -d <path>` creates a new worktree with a detached `HEAD` +at the same commit as the current branch. 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. +`git worktree prune` in the main or any linked worktree to clean up any +stale administrative files. -If a linked working tree is stored on a portable device or network share -which is not always mounted, you can prevent its administrative files from -being pruned by issuing the `git worktree lock` command, optionally -specifying `--reason` to explain why the working tree is locked. +If the working tree for a linked worktree is stored on a portable device +or network share which is not always mounted, you can prevent its +administrative files from being pruned by issuing the `git worktree lock` +command, optionally specifying `--reason` to explain why the worktree is +locked. COMMANDS -------- add <path> [<commit-ish>]:: -Create `<path>` and checkout `<commit-ish>` into it. The new working directory -is linked to the current repository, sharing everything except working -directory specific files such as `HEAD`, `index`, etc. As a convenience, -`<commit-ish>` may be a bare "`-`", which is synonymous with `@{-1}`. +Create a worktree at `<path>` and checkout `<commit-ish>` into it. The new worktree +is linked to the current repository, sharing everything except per-worktree +files such as `HEAD`, `index`, etc. As a convenience, `<commit-ish>` may +be a bare "`-`", which is synonymous with `@{-1}`. + If `<commit-ish>` is a branch name (call it `<branch>`) and is not found, and neither `-b` nor `-B` nor `--detach` are used, but there does @@ -84,100 +88,97 @@ branches from there if `<branch>` is ambiguous but exists on the linkgit:git-config[1]. + If `<commit-ish>` is omitted and neither `-b` nor `-B` nor `--detach` used, -then, as a convenience, the new working tree is associated with a branch -(call it `<branch>`) named after `$(basename <path>)`. If `<branch>` -doesn't exist, a new branch based on `HEAD` is automatically created as -if `-b <branch>` was given. If `<branch>` does exist, it will be -checked out in the new working tree, if it's not checked out anywhere -else, otherwise the command will refuse to create the working tree (unless -`--force` is used). +then, as a convenience, the new worktree is associated with a branch (call +it `<branch>`) named after `$(basename <path>)`. If `<branch>` doesn't +exist, a new branch based on `HEAD` is automatically created as if +`-b <branch>` was given. If `<branch>` does exist, it will be checked out +in the new worktree, if it's not checked out anywhere else, otherwise the +command will refuse to create the worktree (unless `--force` is used). list:: -List details of each working tree. The main working tree is listed first, -followed by each of the linked working trees. The output details include -whether the working tree is bare, the revision currently checked out, the +List details of each worktree. The main worktree is listed first, +followed by each of the linked worktrees. The output details include +whether the worktree is bare, the revision currently checked out, the branch currently checked out (or "detached HEAD" if none), "locked" if -the worktree is locked, "prunable" if the worktree can be pruned by `prune` -command. +the worktree is locked, "prunable" if the worktree can be pruned by the +`prune` command. lock:: -If a working tree is on a portable device or network share which -is not always mounted, lock it to prevent its administrative -files from being pruned automatically. This also prevents it from -being moved or deleted. Optionally, specify a reason for the lock -with `--reason`. +If a worktree is on a portable device or network share which is not always +mounted, lock it to prevent its administrative files from being pruned +automatically. This also prevents it from being moved or deleted. +Optionally, specify a reason for the lock with `--reason`. move:: -Move a working tree to a new location. Note that the main working tree -or linked working trees containing submodules cannot be moved with this -command. (The `git worktree repair` command, however, can reestablish -the connection with linked working trees if you move the main working -tree manually.) +Move a worktree to a new location. Note that the main worktree or linked +worktrees containing submodules cannot be moved with this command. (The +`git worktree repair` command, however, can reestablish the connection +with linked worktrees if you move the main worktree manually.) prune:: -Prune working tree information in `$GIT_DIR/worktrees`. +Prune worktree information in `$GIT_DIR/worktrees`. remove:: -Remove a working tree. Only clean working trees (no untracked files -and no modification in tracked files) can be removed. Unclean working -trees or ones with submodules can be removed with `--force`. The main -working tree cannot be removed. +Remove a worktree. Only clean worktrees (no untracked files and no +modification in tracked files) can be removed. Unclean worktrees or ones +with submodules can be removed with `--force`. The main worktree cannot be +removed. repair [<path>...]:: -Repair working tree administrative files, if possible, if they have -become corrupted or outdated due to external factors. +Repair worktree administrative files, if possible, if they have become +corrupted or outdated due to external factors. + -For instance, if the main working tree (or bare repository) is moved, -linked working trees will be unable to locate it. Running `repair` in -the main working tree will reestablish the connection from linked -working trees back to the main working tree. +For instance, if the main worktree (or bare repository) is moved, linked +worktrees will be unable to locate it. Running `repair` in the main +worktree will reestablish the connection from linked worktrees back to the +main worktree. + -Similarly, if a linked working tree is moved without using `git worktree -move`, the main working tree (or bare repository) will be unable to -locate it. Running `repair` within the recently-moved working tree will -reestablish the connection. If multiple linked working trees are moved, -running `repair` from any working tree with each tree's new `<path>` as -an argument, will reestablish the connection to all the specified paths. +Similarly, if the working tree for a linked worktree is moved without +using `git worktree move`, the main worktree (or bare repository) will be +unable to locate it. Running `repair` within the recently-moved worktree +will reestablish the connection. If multiple linked worktrees are moved, +running `repair` from any worktree with each tree's new `<path>` as an +argument, will reestablish the connection to all the specified paths. + -If both the main working tree and linked working trees have been moved -manually, then running `repair` in the main working tree and specifying the -new `<path>` of each linked working tree will reestablish all connections -in both directions. +If both the main worktree and linked worktrees have been moved manually, +then running `repair` in the main worktree and specifying the new `<path>` +of each linked worktree will reestablish all connections in both +directions. unlock:: -Unlock a working tree, allowing it to be pruned, moved or deleted. +Unlock a worktree, allowing it to be pruned, moved or deleted. OPTIONS ------- -f:: --force:: - By default, `add` refuses to create a new working tree when + By default, `add` refuses to create a new worktree when `<commit-ish>` is a branch name and is already checked out by - another working tree, or if `<path>` is already assigned to some - working tree but is missing (for instance, if `<path>` was deleted + another worktree, or if `<path>` is already assigned to some + worktree but is missing (for instance, if `<path>` was deleted manually). This option overrides these safeguards. To add a missing but - locked working tree path, specify `--force` twice. + locked worktree path, specify `--force` twice. + -`move` refuses to move a locked working tree unless `--force` is specified -twice. If the destination is already assigned to some other working tree but is +`move` refuses to move a locked worktree unless `--force` is specified +twice. If the destination is already assigned to some other worktree but is missing (for instance, if `<new-path>` was deleted manually), then `--force` allows the move to proceed; use `--force` twice if the destination is locked. + -`remove` refuses to remove an unclean working tree unless `--force` is used. -To remove a locked working tree, specify `--force` twice. +`remove` refuses to remove an unclean worktree unless `--force` is used. +To remove a locked worktree, specify `--force` twice. -b <new-branch>:: -B <new-branch>:: With `add`, create a new branch named `<new-branch>` starting at - `<commit-ish>`, and check out `<new-branch>` into the new working tree. + `<commit-ish>`, and check out `<new-branch>` into the new worktree. If `<commit-ish>` is omitted, it defaults to `HEAD`. By default, `-b` refuses to create a new branch if it already exists. `-B` overrides this safeguard, resetting `<new-branch>` to @@ -185,7 +186,7 @@ To remove a locked working tree, specify `--force` twice. -d:: --detach:: - With `add`, detach `HEAD` in the new working tree. See "DETACHED HEAD" + With `add`, detach `HEAD` in the new worktree. See "DETACHED HEAD" in linkgit:git-checkout[1]. --[no-]checkout:: @@ -211,7 +212,7 @@ This can also be set up as the default behaviour by using the `--track` in linkgit:git-branch[1] for details. --lock:: - Keep the working tree locked after creation. This is the + Keep the worktree locked after creation. This is the equivalent of `git worktree lock` after `git worktree add`, but without a race condition. @@ -236,43 +237,42 @@ This can also be set up as the default behaviour by using the With `list`, output additional information about worktrees (see below). --expire <time>:: - With `prune`, only expire unused working trees older than `<time>`. + With `prune`, only expire unused worktrees older than `<time>`. + -With `list`, annotate missing working trees as prunable if they are -older than `<time>`. +With `list`, annotate missing worktrees as prunable if they are older than +`<time>`. --reason <string>:: - With `lock` or with `add --lock`, an explanation why the working tree is locked. + With `lock` or with `add --lock`, an explanation why the worktree + is locked. <worktree>:: - Working trees can be identified by path, either relative or - absolute. + Worktrees can be identified by path, either relative or absolute. + -If the last path components in the working tree's path is unique among -working trees, it can be used to identify a working tree. For example if -you only have two working trees, at `/abc/def/ghi` and `/abc/def/ggg`, -then `ghi` or `def/ghi` is enough to point to the former working tree. +If the last path components in the worktree's path is unique among +worktrees, it can be used to identify a worktree. For example if you only +have two worktrees, at `/abc/def/ghi` and `/abc/def/ggg`, then `ghi` or +`def/ghi` is enough to point to the former worktree. REFS ---- -In multiple working trees, some refs may be shared between all working -trees and some refs are local. One example is `HEAD` which is different for each -working tree. This section is about the sharing rules and how to access -refs of one working tree from another. - -In general, all pseudo refs are per working tree and all refs starting -with `refs/` are shared. Pseudo refs are ones like `HEAD` which are -directly under `$GIT_DIR` instead of inside `$GIT_DIR/refs`. There are -exceptions, however: refs inside `refs/bisect` and `refs/worktree` are not -shared. - -Refs that are per working tree can still be accessed from another -working tree via two special paths, `main-worktree` and `worktrees`. The -former gives access to per-working tree refs of the main working tree, -while the latter to all linked working trees. +When using multiple worktrees, some refs are shared between all worktrees, +but others are specific to an individual worktree. One example is `HEAD`, +which is different for each worktree. This section is about the sharing +rules and how to access refs of one worktree from another. + +In general, all pseudo refs are per-worktree and all refs starting with +`refs/` are shared. Pseudo refs are ones like `HEAD` which are directly +under `$GIT_DIR` instead of inside `$GIT_DIR/refs`. There are exceptions, +however: refs inside `refs/bisect` and `refs/worktree` are not shared. + +Refs that are per-worktree can still be accessed from another worktree via +two special paths, `main-worktree` and `worktrees`. The former gives +access to per-worktree refs of the main worktree, while the latter to all +linked worktrees. For example, `main-worktree/HEAD` or `main-worktree/refs/bisect/good` -resolve to the same value as the main working tree's `HEAD` and +resolve to the same value as the main worktree's `HEAD` and `refs/bisect/good` respectively. Similarly, `worktrees/foo/HEAD` or `worktrees/bar/refs/bisect/bad` are the same as `$GIT_COMMON_DIR/worktrees/foo/HEAD` and @@ -284,13 +284,13 @@ which will handle refs correctly. CONFIGURATION FILE ------------------ -By default, the repository `config` file is shared across all working -trees. If the config variables `core.bare` or `core.worktree` are -present in the common config file and `extensions.worktreeConfig` is -disabled, then they will be applied to the main working tree only. +By default, the repository `config` file is shared across all worktrees. +If the config variables `core.bare` or `core.worktree` are present in the +common config file and `extensions.worktreeConfig` is disabled, then they +will be applied to the main worktree only. -In order to have configuration specific to working trees, you can turn -on the `worktreeConfig` extension, e.g.: +In order to have worktree-specific configuration, you can turn on the +`worktreeConfig` extension, e.g.: ------------ $ git config extensions.worktreeConfig true @@ -303,45 +303,45 @@ versions will refuse to access repositories with this extension. Note that in this file, the exception for `core.bare` and `core.worktree` is gone. If they exist in `$GIT_DIR/config`, you must move -them to the `config.worktree` of the main working tree. You may also -take this opportunity to review and move other configuration that you -do not want to share to all working trees: +them to the `config.worktree` of the main worktree. You may also take this +opportunity to review and move other configuration that you do not want to +share to all worktrees: - `core.worktree` should never be shared. - `core.bare` should not be shared if the value is `core.bare=true`. - - `core.sparseCheckout` is recommended per working tree, unless you - are sure you always use sparse checkout for all working trees. + - `core.sparseCheckout` should not be shared, unless you are sure you + always use sparse checkout for all worktrees. See the documentation of `extensions.worktreeConfig` in linkgit:git-config[1] for more details. DETAILS ------- -Each linked working tree has a private sub-directory in the repository's +Each linked worktree has a private sub-directory in the repository's `$GIT_DIR/worktrees` directory. The private sub-directory's name is usually -the base name of the linked working tree's path, possibly appended with a +the base name of the linked worktree's path, possibly appended with a number to make it unique. For example, when `$GIT_DIR=/path/main/.git` the command `git worktree add /path/other/test-next next` creates the linked -working tree in `/path/other/test-next` and also creates a +worktree in `/path/other/test-next` and also creates a `$GIT_DIR/worktrees/test-next` directory (or `$GIT_DIR/worktrees/test-next1` if `test-next` is already taken). -Within a linked working tree, `$GIT_DIR` is set to point to this private +Within a linked worktree, `$GIT_DIR` is set to point to this private directory (e.g. `/path/main/.git/worktrees/test-next` in the example) and -`$GIT_COMMON_DIR` is set to point back to the main working tree's `$GIT_DIR` +`$GIT_COMMON_DIR` is set to point back to the main worktree's `$GIT_DIR` (e.g. `/path/main/.git`). These settings are made in a `.git` file located at -the top directory of the linked working tree. +the top directory of the linked worktree. Path resolution via `git rev-parse --git-path` uses either `$GIT_DIR` or `$GIT_COMMON_DIR` depending on the path. For example, in the -linked working tree `git rev-parse --git-path HEAD` returns +linked worktree `git rev-parse --git-path HEAD` returns `/path/main/.git/worktrees/test-next/HEAD` (not `/path/other/test-next/.git/HEAD` or `/path/main/.git/HEAD`) while `git rev-parse --git-path refs/heads/master` uses `$GIT_COMMON_DIR` and returns `/path/main/.git/refs/heads/master`, -since refs are shared across all working trees, except `refs/bisect` and +since refs are shared across all worktrees, except `refs/bisect` and `refs/worktree`. See linkgit:gitrepository-layout[5] for more information. The rule of @@ -349,8 +349,8 @@ thumb is do not make any assumption about whether a path belongs to `$GIT_DIR` or `$GIT_COMMON_DIR` when you need to directly access something inside `$GIT_DIR`. Use `git rev-parse --git-path` to get the final path. -If you manually move a linked working tree, you need to update the `gitdir` file -in the entry's directory. For example, if a linked working tree is moved +If you manually move a linked worktree, you need to update the `gitdir` file +in the entry's directory. For example, if a linked worktree is moved to `/newpath/test-next` and its `.git` file points to `/path/main/.git/worktrees/test-next`, then update `/path/main/.git/worktrees/test-next/gitdir` to reference `/newpath/test-next` @@ -359,10 +359,10 @@ automatically. To prevent a `$GIT_DIR/worktrees` entry from being pruned (which can be useful in some situations, such as when the -entry's working tree is stored on a portable device), use the +entry's worktree is stored on a portable device), use the `git worktree lock` command, which adds a file named `locked` to the entry's directory. The file contains the reason in -plain text. For example, if a linked working tree's `.git` file points +plain text. For example, if a linked worktree's `.git` file points to `/path/main/.git/worktrees/test-next` then a file named `/path/main/.git/worktrees/test-next/locked` will prevent the `test-next` entry from being pruned. See @@ -383,11 +383,11 @@ $ git worktree list /path/to/other-linked-worktree 1234abc (detached HEAD) ------------ -The command also shows annotations for each working tree, according to its state. +The command also shows annotations for each worktree, according to its state. These annotations are: - * `locked`, if the working tree is locked. - * `prunable`, if the working tree can be pruned via `git worktree prune`. + * `locked`, if the worktree is locked. + * `prunable`, if the worktree can be pruned via `git worktree prune`. ------------ $ git worktree list @@ -405,14 +405,14 @@ $ git worktree list --verbose /path/to/linked-worktree abcd1234 [master] /path/to/locked-worktree-no-reason abcd5678 (detached HEAD) locked /path/to/locked-worktree-with-reason 1234abcd (brancha) - locked: working tree path is mounted on a portable device + locked: worktree path is mounted on a portable device /path/to/prunable-worktree 5678abc1 (detached HEAD) prunable: gitdir file points to non-existent location ------------ Note that the annotation is moved to the next line if the additional information is available, otherwise it stays on the same line as the -working tree itself. +worktree itself. Porcelain Format ~~~~~~~~~~~~~~~~ @@ -421,7 +421,7 @@ label and value separated by a single space. Boolean attributes (like `bare` and `detached`) are listed as a label only, and are present only if the value is true. Some attributes (like `locked`) can be listed as a label only or with a value depending upon whether a reason is available. The first -attribute of a working tree is always `worktree`, an empty line indicates the +attribute of a worktree is always `worktree`, an empty line indicates the end of the record. For example: ------------ @@ -473,7 +473,7 @@ demands that you fix something immediately. You might typically use linkgit:git-stash[1] to store your changes away temporarily, however, your working tree is in such a state of disarray (with new, moved, and removed files, and other bits and pieces strewn around) that you don't want to risk -disturbing any of it. Instead, you create a temporary linked working tree to +disturbing any of it. Instead, you create a temporary linked worktree to make the emergency fix, remove it when done, and then resume your earlier refactoring session. diff --git a/howto/coordinate-embargoed-releases.html b/howto/coordinate-embargoed-releases.html index 8cff13625..09c398b9e 100644 --- a/howto/coordinate-embargoed-releases.html +++ b/howto/coordinate-embargoed-releases.html @@ -873,7 +873,7 @@ Thanks, <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:03 PST
+ 2022-03-07 14:39:40 PST
</div>
</div>
</body>
diff --git a/howto/keep-canonical-history-correct.html b/howto/keep-canonical-history-correct.html index 48d5046ae..2dc32d185 100644 --- a/howto/keep-canonical-history-correct.html +++ b/howto/keep-canonical-history-correct.html @@ -938,7 +938,7 @@ tip of your <em>master</em> again and redo the two merges:</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:03 PST
+ 2022-03-07 14:39:39 PST
</div>
</div>
</body>
diff --git a/howto/maintain-git.html b/howto/maintain-git.html index b19964ab9..7404a7bf2 100644 --- a/howto/maintain-git.html +++ b/howto/maintain-git.html @@ -1469,7 +1469,7 @@ $ git update-ref -d $mf/ai/topic</code></pre> <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:03 PST
+ 2022-03-07 14:39:40 PST
</div>
</div>
</body>
diff --git a/howto/new-command.html b/howto/new-command.html index 590a8da7c..428c08e0b 100644 --- a/howto/new-command.html +++ b/howto/new-command.html @@ -863,7 +863,7 @@ letter [PATCH 0/n]. <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:01 PST
+ 2022-03-07 14:39:37 PST
</div>
</div>
</body>
diff --git a/howto/rebase-from-internal-branch.html b/howto/rebase-from-internal-branch.html index b8604788f..f23934b3b 100644 --- a/howto/rebase-from-internal-branch.html +++ b/howto/rebase-from-internal-branch.html @@ -895,7 +895,7 @@ the #1' commit.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:03 PST
+ 2022-03-07 14:39:39 PST
</div>
</div>
</body>
diff --git a/howto/rebuild-from-update-hook.html b/howto/rebuild-from-update-hook.html index 92df35cc3..5c332c293 100644 --- a/howto/rebuild-from-update-hook.html +++ b/howto/rebuild-from-update-hook.html @@ -847,7 +847,7 @@ This is still crude and does not protect against simultaneous <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:03 PST
+ 2022-03-07 14:39:39 PST
</div>
</div>
</body>
diff --git a/howto/recover-corrupted-blob-object.html b/howto/recover-corrupted-blob-object.html index 66966ab83..9aa5bc074 100644 --- a/howto/recover-corrupted-blob-object.html +++ b/howto/recover-corrupted-blob-object.html @@ -880,7 +880,7 @@ thing.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:03 PST
+ 2022-03-07 14:39:39 PST
</div>
</div>
</body>
diff --git a/howto/recover-corrupted-object-harder.html b/howto/recover-corrupted-object-harder.html index 61c273102..a822dbb91 100644 --- a/howto/recover-corrupted-object-harder.html +++ b/howto/recover-corrupted-object-harder.html @@ -1189,7 +1189,7 @@ int main(int argc, char **argv) <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:03 PST
+ 2022-03-07 14:39:39 PST
</div>
</div>
</body>
diff --git a/howto/revert-a-faulty-merge.html b/howto/revert-a-faulty-merge.html index 019123db0..ec4c2b8d5 100644 --- a/howto/revert-a-faulty-merge.html +++ b/howto/revert-a-faulty-merge.html @@ -1025,7 +1025,7 @@ P---o---o---M---x---x---W---x---M2 <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:03 PST
+ 2022-03-07 14:39:39 PST
</div>
</div>
</body>
diff --git a/howto/revert-branch-rebase.html b/howto/revert-branch-rebase.html index 48f2a4f23..28c004927 100644 --- a/howto/revert-branch-rebase.html +++ b/howto/revert-branch-rebase.html @@ -907,7 +907,7 @@ Committed merge 7fb9b7262a1d1e0a47bbfdcbbcf50ce0635d3f8f <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:02 PST
+ 2022-03-07 14:39:37 PST
</div>
</div>
</body>
diff --git a/howto/separating-topic-branches.html b/howto/separating-topic-branches.html index 5c497d497..c9b06f6d2 100644 --- a/howto/separating-topic-branches.html +++ b/howto/separating-topic-branches.html @@ -841,7 +841,7 @@ o---o"master"</code></pre> <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:03 PST
+ 2022-03-07 14:39:38 PST
</div>
</div>
</body>
diff --git a/howto/setup-git-server-over-http.html b/howto/setup-git-server-over-http.html index ae8e6602e..7e61eca2e 100644 --- a/howto/setup-git-server-over-http.html +++ b/howto/setup-git-server-over-http.html @@ -1071,7 +1071,7 @@ help diagnosing the problem, but removes security checks.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:02 PST
+ 2022-03-07 14:39:38 PST
</div>
</div>
</body>
diff --git a/howto/update-hook-example.html b/howto/update-hook-example.html index cc7bc7269..f1e950001 100644 --- a/howto/update-hook-example.html +++ b/howto/update-hook-example.html @@ -930,7 +930,7 @@ that JC can make non-fast-forward pushes on it.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:02 PST
+ 2022-03-07 14:39:38 PST
</div>
</div>
</body>
diff --git a/howto/use-git-daemon.html b/howto/use-git-daemon.html index 68cb23234..a4caf356c 100644 --- a/howto/use-git-daemon.html +++ b/howto/use-git-daemon.html @@ -791,7 +791,7 @@ a good practice to put the paths after a "--" separator.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:02 PST
+ 2022-03-07 14:39:38 PST
</div>
</div>
</body>
diff --git a/howto/using-merge-subtree.html b/howto/using-merge-subtree.html index ac3be6ad2..925ab8690 100644 --- a/howto/using-merge-subtree.html +++ b/howto/using-merge-subtree.html @@ -848,7 +848,7 @@ Please note that if the other project merges from you, then it will <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:02 PST
+ 2022-03-07 14:39:37 PST
</div>
</div>
</body>
diff --git a/howto/using-signed-tag-in-pull-request.html b/howto/using-signed-tag-in-pull-request.html index 4a3575858..9d0fbc6d2 100644 --- a/howto/using-signed-tag-in-pull-request.html +++ b/howto/using-signed-tag-in-pull-request.html @@ -952,7 +952,7 @@ as part of the merge commit.</p></div> <div id="footer">
<div id="footer-text">
Last updated
- 2022-02-25 16:20:02 PST
+ 2022-03-07 14:39:37 PST
</div>
</div>
</body>
|