Skip to content

Commit e79e313

Browse files
sunshinecogitster
authored andcommitted
git-worktree.txt: employ fixed-width typeface consistently
git-worktree documentation generally does a good job of formatting literal text using a fixed-width typeface, however, some instances of unformatted literal text have crept in over time. Fix these. While at it, also fix a few incorrect typefaces resulting from wrong choice of Asciidoc quotes. Signed-off-by: Eric Sunshine <[email protected]> Reviewed-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 47ae905 commit e79e313

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

Documentation/git-worktree.txt

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Manage multiple working trees attached to the same repository.
2525
A git repository can support multiple working trees, allowing you to check
2626
out more than one branch at a time. With `git worktree add` a new working
2727
tree is associated with the repository. This new working tree is called a
28-
"linked working tree" as opposed to the "main working tree" prepared by "git
29-
init" or "git clone". A repository has one main working tree (if it's not a
28+
"linked working tree" as opposed to the "main working tree" prepared by `git
29+
init` or `git clone`. A repository has one main working tree (if it's not a
3030
bare repository) and zero or more linked working trees. When you are done
3131
with a linked working tree, remove it with `git worktree remove`.
3232

@@ -48,10 +48,10 @@ add <path> [<commit-ish>]::
4848

4949
Create `<path>` and checkout `<commit-ish>` into it. The new working directory
5050
is linked to the current repository, sharing everything except working
51-
directory specific files such as HEAD, index, etc. `-` may also be
51+
directory specific files such as `HEAD`, `index`, etc. `-` may also be
5252
specified as `<commit-ish>`; it is synonymous with `@{-1}`.
5353
+
54-
If <commit-ish> is a branch name (call it `<branch>`) and is not found,
54+
If `<commit-ish>` is a branch name (call it `<branch>`) and is not found,
5555
and neither `-b` nor `-B` nor `--detach` are used, but there does
5656
exist a tracking branch in exactly one remote (call it `<remote>`)
5757
with a matching name, treat as equivalent to:
@@ -66,13 +66,13 @@ one for the purposes of disambiguation, even if the `<branch>` isn't
6666
unique across all remotes. Set it to
6767
e.g. `checkout.defaultRemote=origin` to always checkout remote
6868
branches from there if `<branch>` is ambiguous but exists on the
69-
'origin' remote. See also `checkout.defaultRemote` in
69+
`origin` remote. See also `checkout.defaultRemote` in
7070
linkgit:git-config[1].
7171
+
7272
If `<commit-ish>` is omitted and neither `-b` nor `-B` nor `--detach` used,
7373
then, as a convenience, the new worktree is associated with a branch
7474
(call it `<branch>`) named after `$(basename <path>)`. If `<branch>`
75-
doesn't exist, a new branch based on HEAD is automatically created as
75+
doesn't exist, a new branch based on `HEAD` is automatically created as
7676
if `-b <branch>` was given. If `<branch>` does exist, it will be
7777
checked out in the new worktree, if it's not checked out anywhere
7878
else, otherwise the command will refuse to create the worktree (unless
@@ -83,7 +83,7 @@ list::
8383
List details of each worktree. The main worktree is listed first, followed by
8484
each of the linked worktrees. The output details include if the worktree is
8585
bare, the revision currently checked out, and the branch currently checked out
86-
(or 'detached HEAD' if none).
86+
(or "detached HEAD" if none).
8787

8888
lock::
8989

@@ -100,7 +100,7 @@ or linked working trees containing submodules cannot be moved.
100100

101101
prune::
102102

103-
Prune working tree information in $GIT_DIR/worktrees.
103+
Prune working tree information in `$GIT_DIR/worktrees`.
104104

105105
remove::
106106

@@ -128,7 +128,7 @@ OPTIONS
128128
`move` refuses to move a locked working tree unless `--force` is specified
129129
twice. If the destination is already assigned to some other working tree but is
130130
missing (for instance, if `<new-path>` was deleted manually), then `--force`
131-
allows the move to proceed; use --force twice if the destination is locked.
131+
allows the move to proceed; use `--force` twice if the destination is locked.
132132
+
133133
`remove` refuses to remove an unclean working tree unless `--force` is used.
134134
To remove a locked working tree, specify `--force` twice.
@@ -137,13 +137,13 @@ To remove a locked working tree, specify `--force` twice.
137137
-B <new-branch>::
138138
With `add`, create a new branch named `<new-branch>` starting at
139139
`<commit-ish>`, and check out `<new-branch>` into the new working tree.
140-
If `<commit-ish>` is omitted, it defaults to HEAD.
140+
If `<commit-ish>` is omitted, it defaults to `HEAD`.
141141
By default, `-b` refuses to create a new branch if it already
142142
exists. `-B` overrides this safeguard, resetting `<new-branch>` to
143143
`<commit-ish>`.
144144

145145
--detach::
146-
With `add`, detach HEAD in the new working tree. See "DETACHED HEAD"
146+
With `add`, detach `HEAD` in the new working tree. See "DETACHED HEAD"
147147
in linkgit:git-checkout[1].
148148

149149
--[no-]checkout::
@@ -154,7 +154,7 @@ To remove a locked working tree, specify `--force` twice.
154154

155155
--[no-]guess-remote::
156156
With `worktree add <path>`, without `<commit-ish>`, instead
157-
of creating a new branch from HEAD, if there exists a tracking
157+
of creating a new branch from `HEAD`, if there exists a tracking
158158
branch in exactly one remote matching the basename of `<path>`,
159159
base the new branch on the remote-tracking branch, and mark
160160
the remote-tracking branch as "upstream" from the new branch.
@@ -166,7 +166,7 @@ This can also be set up as the default behaviour by using the
166166
When creating a new branch, if `<commit-ish>` is a branch,
167167
mark it as "upstream" from the new branch. This is the
168168
default if `<commit-ish>` is a remote-tracking branch. See
169-
"--track" in linkgit:git-branch[1] for details.
169+
`--track` in linkgit:git-branch[1] for details.
170170

171171
--lock::
172172
Keep the working tree locked after creation. This is the
@@ -185,14 +185,14 @@ This can also be set up as the default behaviour by using the
185185

186186
-q::
187187
--quiet::
188-
With 'add', suppress feedback messages.
188+
With `add`, suppress feedback messages.
189189

190190
-v::
191191
--verbose::
192192
With `prune`, report all removals.
193193

194194
--expire <time>::
195-
With `prune`, only expire unused working trees older than <time>.
195+
With `prune`, only expire unused working trees older than `<time>`.
196196

197197
--reason <string>::
198198
With `lock`, an explanation why the working tree is locked.
@@ -203,47 +203,47 @@ This can also be set up as the default behaviour by using the
203203
+
204204
If the last path components in the working tree's path is unique among
205205
working trees, it can be used to identify worktrees. For example if
206-
you only have two working trees, at "/abc/def/ghi" and "/abc/def/ggg",
207-
then "ghi" or "def/ghi" is enough to point to the former working tree.
206+
you only have two working trees, at `/abc/def/ghi` and `/abc/def/ggg`,
207+
then `ghi` or `def/ghi` is enough to point to the former working tree.
208208

209209
REFS
210210
----
211211
In multiple working trees, some refs may be shared between all working
212-
trees, some refs are local. One example is HEAD is different for all
212+
trees, some refs are local. One example is `HEAD` is different for all
213213
working trees. This section is about the sharing rules and how to access
214214
refs of one working tree from another.
215215

216216
In general, all pseudo refs are per working tree and all refs starting
217-
with "refs/" are shared. Pseudo refs are ones like HEAD which are
218-
directly under GIT_DIR instead of inside GIT_DIR/refs. There is one
219-
exception to this: refs inside refs/bisect and refs/worktree is not
217+
with `refs/` are shared. Pseudo refs are ones like `HEAD` which are
218+
directly under `$GIT_DIR` instead of inside `$GIT_DIR/refs`. There is one
219+
exception to this: refs inside `refs/bisect` and `refs/worktree` is not
220220
shared.
221221

222222
Refs that are per working tree can still be accessed from another
223-
working tree via two special paths, main-worktree and worktrees. The
223+
working tree via two special paths, `main-worktree` and `worktrees`. The
224224
former gives access to per-worktree refs of the main working tree,
225225
while the latter to all linked working trees.
226226

227-
For example, main-worktree/HEAD or main-worktree/refs/bisect/good
228-
resolve to the same value as the main working tree's HEAD and
229-
refs/bisect/good respectively. Similarly, worktrees/foo/HEAD or
230-
worktrees/bar/refs/bisect/bad are the same as
231-
GIT_COMMON_DIR/worktrees/foo/HEAD and
232-
GIT_COMMON_DIR/worktrees/bar/refs/bisect/bad.
227+
For example, `main-worktree/HEAD` or `main-worktree/refs/bisect/good`
228+
resolve to the same value as the main working tree's `HEAD` and
229+
`refs/bisect/good` respectively. Similarly, `worktrees/foo/HEAD` or
230+
`worktrees/bar/refs/bisect/bad` are the same as
231+
`$GIT_COMMON_DIR/worktrees/foo/HEAD` and
232+
`$GIT_COMMON_DIR/worktrees/bar/refs/bisect/bad`.
233233

234-
To access refs, it's best not to look inside GIT_DIR directly. Instead
234+
To access refs, it's best not to look inside `$GIT_DIR` directly. Instead
235235
use commands such as linkgit:git-rev-parse[1] or linkgit:git-update-ref[1]
236236
which will handle refs correctly.
237237

238238
CONFIGURATION FILE
239239
------------------
240-
By default, the repository "config" file is shared across all working
240+
By default, the repository `config` file is shared across all working
241241
trees. If the config variables `core.bare` or `core.worktree` are
242242
already present in the config file, they will be applied to the main
243243
working trees only.
244244

245245
In order to have configuration specific to working trees, you can turn
246-
on "worktreeConfig" extension, e.g.:
246+
on `worktreeConfig` extension, e.g.:
247247

248248
------------
249249
$ git config extensions.worktreeConfig true
@@ -255,7 +255,7 @@ configuration in this file with `git config --worktree`. Older Git
255255
versions will refuse to access repositories with this extension.
256256

257257
Note that in this file, the exception for `core.bare` and `core.worktree`
258-
is gone. If you have them in $GIT_DIR/config before, you must move
258+
is gone. If you have them in `$GIT_DIR/config` before, you must move
259259
them to the `config.worktree` of the main working tree. You may also
260260
take this opportunity to review and move other configuration that you
261261
do not want to share to all working trees:
@@ -268,59 +268,59 @@ do not want to share to all working trees:
268268
DETAILS
269269
-------
270270
Each linked working tree has a private sub-directory in the repository's
271-
$GIT_DIR/worktrees directory. The private sub-directory's name is usually
271+
`$GIT_DIR/worktrees` directory. The private sub-directory's name is usually
272272
the base name of the linked working tree's path, possibly appended with a
273273
number to make it unique. For example, when `$GIT_DIR=/path/main/.git` the
274274
command `git worktree add /path/other/test-next next` creates the linked
275275
working tree in `/path/other/test-next` and also creates a
276276
`$GIT_DIR/worktrees/test-next` directory (or `$GIT_DIR/worktrees/test-next1`
277277
if `test-next` is already taken).
278278

279-
Within a linked working tree, $GIT_DIR is set to point to this private
279+
Within a linked working tree, `$GIT_DIR` is set to point to this private
280280
directory (e.g. `/path/main/.git/worktrees/test-next` in the example) and
281-
$GIT_COMMON_DIR is set to point back to the main working tree's $GIT_DIR
281+
`$GIT_COMMON_DIR` is set to point back to the main working tree's `$GIT_DIR`
282282
(e.g. `/path/main/.git`). These settings are made in a `.git` file located at
283283
the top directory of the linked working tree.
284284

285285
Path resolution via `git rev-parse --git-path` uses either
286-
$GIT_DIR or $GIT_COMMON_DIR depending on the path. For example, in the
286+
`$GIT_DIR` or `$GIT_COMMON_DIR` depending on the path. For example, in the
287287
linked working tree `git rev-parse --git-path HEAD` returns
288288
`/path/main/.git/worktrees/test-next/HEAD` (not
289289
`/path/other/test-next/.git/HEAD` or `/path/main/.git/HEAD`) while `git
290290
rev-parse --git-path refs/heads/master` uses
291-
$GIT_COMMON_DIR and returns `/path/main/.git/refs/heads/master`,
292-
since refs are shared across all working trees, except refs/bisect and
293-
refs/worktree.
291+
`$GIT_COMMON_DIR` and returns `/path/main/.git/refs/heads/master`,
292+
since refs are shared across all working trees, except `refs/bisect` and
293+
`refs/worktree`.
294294

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

300-
If you manually move a linked working tree, you need to update the 'gitdir' file
300+
If you manually move a linked working tree, you need to update the `gitdir` file
301301
in the entry's directory. For example, if a linked working tree is moved
302302
to `/newpath/test-next` and its `.git` file points to
303303
`/path/main/.git/worktrees/test-next`, then update
304304
`/path/main/.git/worktrees/test-next/gitdir` to reference `/newpath/test-next`
305305
instead.
306306

307-
To prevent a $GIT_DIR/worktrees entry from being pruned (which
307+
To prevent a `$GIT_DIR/worktrees` entry from being pruned (which
308308
can be useful in some situations, such as when the
309309
entry's working tree is stored on a portable device), use the
310310
`git worktree lock` command, which adds a file named
311-
'locked' to the entry's directory. The file contains the reason in
311+
`locked` to the entry's directory. The file contains the reason in
312312
plain text. For example, if a linked working tree's `.git` file points
313313
to `/path/main/.git/worktrees/test-next` then a file named
314314
`/path/main/.git/worktrees/test-next/locked` will prevent the
315315
`test-next` entry from being pruned. See
316316
linkgit:gitrepository-layout[5] for details.
317317

318-
When extensions.worktreeConfig is enabled, the config file
318+
When `extensions.worktreeConfig` is enabled, the config file
319319
`.git/worktrees/<id>/config.worktree` is read after `.git/config` is.
320320

321321
LIST OUTPUT FORMAT
322322
------------------
323-
The worktree list command has two output formats. The default format shows the
323+
The `worktree list` command has two output formats. The default format shows the
324324
details on a single line with columns. For example:
325325

326326
------------
@@ -333,8 +333,8 @@ $ git worktree list
333333
Porcelain Format
334334
~~~~~~~~~~~~~~~~
335335
The porcelain format has a line per attribute. Attributes are listed with a
336-
label and value separated by a single space. Boolean attributes (like 'bare'
337-
and 'detached') are listed as a label only, and are only present if and only
336+
label and value separated by a single space. Boolean attributes (like `bare`
337+
and `detached`) are listed as a label only, and are only present if and only
338338
if the value is true. The first attribute of a worktree is always `worktree`,
339339
an empty line indicates the end of the record. For example:
340340

0 commit comments

Comments
 (0)