Skip to content

Commit f13a146

Browse files
derrickstoleegitster
authored andcommitted
worktree: use 'worktree' over 'working tree'
It is helpful to distinguish between a 'working tree' and a 'worktree'. A worktree contains a working tree plus additional metadata. This metadata includes per-worktree refs and worktree-specific config. This is the sixth of multiple changes to git-worktree.txt, restricted to the DETAILS section. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7b21582 commit f13a146

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Documentation/git-worktree.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -319,38 +319,38 @@ linkgit:git-config[1] for more details.
319319

320320
DETAILS
321321
-------
322-
Each linked working tree has a private sub-directory in the repository's
322+
Each linked worktree has a private sub-directory in the repository's
323323
`$GIT_DIR/worktrees` directory. The private sub-directory's name is usually
324-
the base name of the linked working tree's path, possibly appended with a
324+
the base name of the linked worktree's path, possibly appended with a
325325
number to make it unique. For example, when `$GIT_DIR=/path/main/.git` the
326326
command `git worktree add /path/other/test-next next` creates the linked
327-
working tree in `/path/other/test-next` and also creates a
327+
worktree in `/path/other/test-next` and also creates a
328328
`$GIT_DIR/worktrees/test-next` directory (or `$GIT_DIR/worktrees/test-next1`
329329
if `test-next` is already taken).
330330

331-
Within a linked working tree, `$GIT_DIR` is set to point to this private
331+
Within a linked worktree, `$GIT_DIR` is set to point to this private
332332
directory (e.g. `/path/main/.git/worktrees/test-next` in the example) and
333-
`$GIT_COMMON_DIR` is set to point back to the main working tree's `$GIT_DIR`
333+
`$GIT_COMMON_DIR` is set to point back to the main worktree's `$GIT_DIR`
334334
(e.g. `/path/main/.git`). These settings are made in a `.git` file located at
335-
the top directory of the linked working tree.
335+
the top directory of the linked worktree.
336336

337337
Path resolution via `git rev-parse --git-path` uses either
338338
`$GIT_DIR` or `$GIT_COMMON_DIR` depending on the path. For example, in the
339-
linked working tree `git rev-parse --git-path HEAD` returns
339+
linked worktree `git rev-parse --git-path HEAD` returns
340340
`/path/main/.git/worktrees/test-next/HEAD` (not
341341
`/path/other/test-next/.git/HEAD` or `/path/main/.git/HEAD`) while `git
342342
rev-parse --git-path refs/heads/master` uses
343343
`$GIT_COMMON_DIR` and returns `/path/main/.git/refs/heads/master`,
344-
since refs are shared across all working trees, except `refs/bisect` and
344+
since refs are shared across all worktrees, except `refs/bisect` and
345345
`refs/worktree`.
346346

347347
See linkgit:gitrepository-layout[5] for more information. The rule of
348348
thumb is do not make any assumption about whether a path belongs to
349349
`$GIT_DIR` or `$GIT_COMMON_DIR` when you need to directly access something
350350
inside `$GIT_DIR`. Use `git rev-parse --git-path` to get the final path.
351351

352-
If you manually move a linked working tree, you need to update the `gitdir` file
353-
in the entry's directory. For example, if a linked working tree is moved
352+
If you manually move a linked worktree, you need to update the `gitdir` file
353+
in the entry's directory. For example, if a linked worktree is moved
354354
to `/newpath/test-next` and its `.git` file points to
355355
`/path/main/.git/worktrees/test-next`, then update
356356
`/path/main/.git/worktrees/test-next/gitdir` to reference `/newpath/test-next`
@@ -359,10 +359,10 @@ automatically.
359359

360360
To prevent a `$GIT_DIR/worktrees` entry from being pruned (which
361361
can be useful in some situations, such as when the
362-
entry's working tree is stored on a portable device), use the
362+
entry's worktree is stored on a portable device), use the
363363
`git worktree lock` command, which adds a file named
364364
`locked` to the entry's directory. The file contains the reason in
365-
plain text. For example, if a linked working tree's `.git` file points
365+
plain text. For example, if a linked worktree's `.git` file points
366366
to `/path/main/.git/worktrees/test-next` then a file named
367367
`/path/main/.git/worktrees/test-next/locked` will prevent the
368368
`test-next` entry from being pruned. See

0 commit comments

Comments
 (0)