Skip to content

Commit 181e372

Browse files
pcloudsgitster
authored andcommitted
git-checkout.txt: fix monospace typeset
Add backticks where we have none, replace single quotes with backticks and replace double-quotes. Drop double-quotes from nested constructions such as `"@{-1}"`. Helped-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9d223d4 commit 181e372

File tree

1 file changed

+81
-81
lines changed

1 file changed

+81
-81
lines changed

Documentation/git-checkout.txt

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ also update `HEAD` to set the specified branch as the current
2424
branch.
2525

2626
'git checkout' [<branch>]::
27-
To prepare for working on <branch>, switch to it by updating
27+
To prepare for working on `<branch>`, switch to it by updating
2828
the index and the files in the working tree, and by pointing
29-
HEAD at the branch. Local modifications to the files in the
29+
`HEAD` at the branch. Local modifications to the files in the
3030
working tree are kept, so that they can be committed to the
31-
<branch>.
31+
`<branch>`.
3232
+
33-
If <branch> is not found but there does exist a tracking branch in
34-
exactly one remote (call it <remote>) with a matching name, treat as
33+
If `<branch>` is not found but there does exist a tracking branch in
34+
exactly one remote (call it `<remote>`) with a matching name, treat as
3535
equivalent to
3636
+
3737
------------
@@ -47,7 +47,7 @@ branches from there if `<branch>` is ambiguous but exists on the
4747
'origin' remote. See also `checkout.defaultRemote` in
4848
linkgit:git-config[1].
4949
+
50-
You could omit <branch>, in which case the command degenerates to
50+
You could omit `<branch>`, in which case the command degenerates to
5151
"check out the current branch", which is a glorified no-op with
5252
rather expensive side-effects to show only the tracking information,
5353
if exists, for the current branch.
@@ -61,7 +61,7 @@ if exists, for the current branch.
6161
`--track` without `-b` implies branch creation; see the
6262
description of `--track` below.
6363
+
64-
If `-B` is given, <new_branch> is created if it doesn't exist; otherwise, it
64+
If `-B` is given, `<new_branch>` is created if it doesn't exist; otherwise, it
6565
is reset. This is the transactional equivalent of
6666
+
6767
------------
@@ -75,25 +75,25 @@ successful.
7575
'git checkout' --detach [<branch>]::
7676
'git checkout' [--detach] <commit>::
7777

78-
Prepare to work on top of <commit>, by detaching HEAD at it
78+
Prepare to work on top of `<commit>`, by detaching `HEAD` at it
7979
(see "DETACHED HEAD" section), and updating the index and the
8080
files in the working tree. Local modifications to the files
8181
in the working tree are kept, so that the resulting working
8282
tree will be the state recorded in the commit plus the local
8383
modifications.
8484
+
85-
When the <commit> argument is a branch name, the `--detach` option can
86-
be used to detach HEAD at the tip of the branch (`git checkout
87-
<branch>` would check out that branch without detaching HEAD).
85+
When the `<commit>` argument is a branch name, the `--detach` option can
86+
be used to detach `HEAD` at the tip of the branch (`git checkout
87+
<branch>` would check out that branch without detaching `HEAD`).
8888
+
89-
Omitting <branch> detaches HEAD at the tip of the current branch.
89+
Omitting `<branch>` detaches `HEAD` at the tip of the current branch.
9090

9191
'git checkout' [<tree-ish>] [--] <pathspec>...::
9292

9393
Overwrite paths in the working tree by replacing with the
94-
contents in the index or in the <tree-ish> (most often a
95-
commit). When a <tree-ish> is given, the paths that
96-
match the <pathspec> are updated both in the index and in
94+
contents in the index or in the `<tree-ish>` (most often a
95+
commit). When a `<tree-ish>` is given, the paths that
96+
match the `<pathspec>` are updated both in the index and in
9797
the working tree.
9898
+
9999
The index may contain unmerged entries because of a previous failed merge.
@@ -128,7 +128,7 @@ OPTIONS
128128
-f::
129129
--force::
130130
When switching branches, proceed even if the index or the
131-
working tree differs from HEAD. This is used to throw away
131+
working tree differs from `HEAD`. This is used to throw away
132132
local changes.
133133
+
134134
When checking out paths from the index, do not fail upon unmerged
@@ -155,12 +155,12 @@ on your side branch as `theirs` (i.e. "one contributor's work on top
155155
of it").
156156

157157
-b <new_branch>::
158-
Create a new branch named <new_branch> and start it at
159-
<start_point>; see linkgit:git-branch[1] for details.
158+
Create a new branch named `<new_branch>` and start it at
159+
`<start_point>`; see linkgit:git-branch[1] for details.
160160

161161
-B <new_branch>::
162-
Creates the branch <new_branch> and start it at <start_point>;
163-
if it already exists, then reset it to <start_point>. This is
162+
Creates the branch `<new_branch>` and start it at `<start_point>`;
163+
if it already exists, then reset it to `<start_point>`. This is
164164
equivalent to running "git branch" with "-f"; see
165165
linkgit:git-branch[1] for details.
166166

@@ -173,15 +173,15 @@ If no `-b` option is given, the name of the new branch will be
173173
derived from the remote-tracking branch, by looking at the local part of
174174
the refspec configured for the corresponding remote, and then stripping
175175
the initial part up to the "*".
176-
This would tell us to use "hack" as the local branch when branching
177-
off of "origin/hack" (or "remotes/origin/hack", or even
178-
"refs/remotes/origin/hack"). If the given name has no slash, or the above
176+
This would tell us to use `hack` as the local branch when branching
177+
off of `origin/hack` (or `remotes/origin/hack`, or even
178+
`refs/remotes/origin/hack`). If the given name has no slash, or the above
179179
guessing results in an empty name, the guessing is aborted. You can
180180
explicitly give a name with `-b` in such a case.
181181

182182
--no-track::
183183
Do not set up "upstream" configuration, even if the
184-
branch.autoSetupMerge configuration variable is true.
184+
`branch.autoSetupMerge` configuration variable is true.
185185

186186
-l::
187187
Create the new branch's reflog; see linkgit:git-branch[1] for
@@ -190,21 +190,21 @@ explicitly give a name with `-b` in such a case.
190190
--detach::
191191
Rather than checking out a branch to work on it, check out a
192192
commit for inspection and discardable experiments.
193-
This is the default behavior of "git checkout <commit>" when
194-
<commit> is not a branch name. See the "DETACHED HEAD" section
193+
This is the default behavior of `git checkout <commit>` when
194+
`<commit>` is not a branch name. See the "DETACHED HEAD" section
195195
below for details.
196196

197197
--orphan <new_branch>::
198-
Create a new 'orphan' branch, named <new_branch>, started from
199-
<start_point> and switch to it. The first commit made on this
198+
Create a new 'orphan' branch, named `<new_branch>`, started from
199+
`<start_point>` and switch to it. The first commit made on this
200200
new branch will have no parents and it will be the root of a new
201201
history totally disconnected from all the other branches and
202202
commits.
203203
+
204204
The index and the working tree are adjusted as if you had previously run
205-
"git checkout <start_point>". This allows you to start a new history
206-
that records a set of paths similar to <start_point> by easily running
207-
"git commit -a" to make the root commit.
205+
`git checkout <start_point>`. This allows you to start a new history
206+
that records a set of paths similar to `<start_point>` by easily running
207+
`git commit -a` to make the root commit.
208208
+
209209
This can be useful when you want to publish the tree from a commit
210210
without exposing its full history. You might want to do this to publish
@@ -213,17 +213,17 @@ whose full history contains proprietary or otherwise encumbered bits of
213213
code.
214214
+
215215
If you want to start a disconnected history that records a set of paths
216-
that is totally different from the one of <start_point>, then you should
216+
that is totally different from the one of `<start_point>`, then you should
217217
clear the index and the working tree right after creating the orphan
218-
branch by running "git rm -rf ." from the top level of the working tree.
218+
branch by running `git rm -rf .` from the top level of the working tree.
219219
Afterwards you will be ready to prepare your new files, repopulating the
220220
working tree, by copying them from elsewhere, extracting a tarball, etc.
221221

222222
--ignore-skip-worktree-bits::
223223
In sparse checkout mode, `git checkout -- <paths>` would
224-
update only entries matched by <paths> and sparse patterns
225-
in $GIT_DIR/info/sparse-checkout. This option ignores
226-
the sparse patterns and adds back any files in <paths>.
224+
update only entries matched by `<paths>` and sparse patterns
225+
in `$GIT_DIR/info/sparse-checkout`. This option ignores
226+
the sparse patterns and adds back any files in `<paths>`.
227227

228228
-m::
229229
--merge::
@@ -245,18 +245,18 @@ When checking out paths from the index, this option lets you recreate
245245
the conflicted merge in the specified paths.
246246

247247
--conflict=<style>::
248-
The same as --merge option above, but changes the way the
248+
The same as `--merge` option above, but changes the way the
249249
conflicting hunks are presented, overriding the
250-
merge.conflictStyle configuration variable. Possible values are
250+
`merge.conflictStyle` configuration variable. Possible values are
251251
"merge" (default) and "diff3" (in addition to what is shown by
252252
"merge" style, shows the original contents).
253253

254254
-p::
255255
--patch::
256256
Interactively select hunks in the difference between the
257-
<tree-ish> (or the index, if unspecified) and the working
257+
`<tree-ish>` (or the index, if unspecified) and the working
258258
tree. The chosen hunks are then applied in reverse to the
259-
working tree (and if a <tree-ish> was specified, the index).
259+
working tree (and if a `<tree-ish>` was specified, the index).
260260
+
261261
This means that you can use `git checkout -p` to selectively discard
262262
edits from your current working tree. See the ``Interactive Mode''
@@ -279,13 +279,13 @@ Note that this option uses the no overlay mode by default (see also
279279

280280
--recurse-submodules::
281281
--no-recurse-submodules::
282-
Using --recurse-submodules will update the content of all initialized
282+
Using `--recurse-submodules` will update the content of all initialized
283283
submodules according to the commit recorded in the superproject. If
284284
local modifications in a submodule would be overwritten the checkout
285-
will fail unless `-f` is used. If nothing (or --no-recurse-submodules)
285+
will fail unless `-f` is used. If nothing (or `--no-recurse-submodules`)
286286
is used, the work trees of submodules will not be updated.
287-
Just like linkgit:git-submodule[1], this will detach the
288-
submodules HEAD.
287+
Just like linkgit:git-submodule[1], this will detach `HEAD` of the
288+
submodule.
289289

290290
--no-guess::
291291
Do not attempt to create a branch if a remote tracking branch
@@ -296,21 +296,21 @@ Note that this option uses the no overlay mode by default (see also
296296
In the default overlay mode, `git checkout` never
297297
removes files from the index or the working tree. When
298298
specifying `--no-overlay`, files that appear in the index and
299-
working tree, but not in <tree-ish> are removed, to make them
300-
match <tree-ish> exactly.
299+
working tree, but not in `<tree-ish>` are removed, to make them
300+
match `<tree-ish>` exactly.
301301

302302
<branch>::
303303
Branch to checkout; if it refers to a branch (i.e., a name that,
304304
when prepended with "refs/heads/", is a valid ref), then that
305305
branch is checked out. Otherwise, if it refers to a valid
306-
commit, your HEAD becomes "detached" and you are no longer on
306+
commit, your `HEAD` becomes "detached" and you are no longer on
307307
any branch (see below for details).
308308
+
309-
You can use the `"@{-N}"` syntax to refer to the N-th last
309+
You can use the `@{-N}` syntax to refer to the N-th last
310310
branch/commit checked out using "git checkout" operation. You may
311-
also specify `-` which is synonymous to `"@{-1}"`.
311+
also specify `-` which is synonymous to `@{-1}`.
312312
+
313-
As a special case, you may use `"A...B"` as a shortcut for the
313+
As a special case, you may use `A...B` as a shortcut for the
314314
merge base of `A` and `B` if there is exactly one merge base. You can
315315
leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
316316

@@ -319,7 +319,7 @@ leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
319319

320320
<start_point>::
321321
The name of a commit at which to start the new branch; see
322-
linkgit:git-branch[1] for details. Defaults to HEAD.
322+
linkgit:git-branch[1] for details. Defaults to `HEAD`.
323323

324324
<tree-ish>::
325325
Tree to checkout from (when paths are given). If not specified,
@@ -329,9 +329,9 @@ leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
329329

330330
DETACHED HEAD
331331
-------------
332-
HEAD normally refers to a named branch (e.g. 'master'). Meanwhile, each
332+
`HEAD` normally refers to a named branch (e.g. `master`). Meanwhile, each
333333
branch refers to a specific commit. Let's look at a repo with three
334-
commits, one of them tagged, and with branch 'master' checked out:
334+
commits, one of them tagged, and with branch `master` checked out:
335335

336336
------------
337337
HEAD (refers to branch 'master')
@@ -344,10 +344,10 @@ a---b---c branch 'master' (refers to commit 'c')
344344
------------
345345

346346
When a commit is created in this state, the branch is updated to refer to
347-
the new commit. Specifically, 'git commit' creates a new commit 'd', whose
348-
parent is commit 'c', and then updates branch 'master' to refer to new
349-
commit 'd'. HEAD still refers to branch 'master' and so indirectly now refers
350-
to commit 'd':
347+
the new commit. Specifically, 'git commit' creates a new commit `d`, whose
348+
parent is commit `c`, and then updates branch `master` to refer to new
349+
commit `d`. `HEAD` still refers to branch `master` and so indirectly now refers
350+
to commit `d`:
351351

352352
------------
353353
$ edit; git add; git commit
@@ -364,7 +364,7 @@ a---b---c---d branch 'master' (refers to commit 'd')
364364
It is sometimes useful to be able to checkout a commit that is not at
365365
the tip of any named branch, or even to create a new commit that is not
366366
referenced by a named branch. Let's look at what happens when we
367-
checkout commit 'b' (here we show two ways this may be done):
367+
checkout commit `b` (here we show two ways this may be done):
368368

369369
------------
370370
$ git checkout v2.0 # or
@@ -379,9 +379,9 @@ a---b---c---d branch 'master' (refers to commit 'd')
379379
tag 'v2.0' (refers to commit 'b')
380380
------------
381381

382-
Notice that regardless of which checkout command we use, HEAD now refers
383-
directly to commit 'b'. This is known as being in detached HEAD state.
384-
It means simply that HEAD refers to a specific commit, as opposed to
382+
Notice that regardless of which checkout command we use, `HEAD` now refers
383+
directly to commit `b`. This is known as being in detached `HEAD` state.
384+
It means simply that `HEAD` refers to a specific commit, as opposed to
385385
referring to a named branch. Let's see what happens when we create a commit:
386386

387387
------------
@@ -398,7 +398,7 @@ a---b---c---d branch 'master' (refers to commit 'd')
398398
tag 'v2.0' (refers to commit 'b')
399399
------------
400400

401-
There is now a new commit 'e', but it is referenced only by HEAD. We can
401+
There is now a new commit `e`, but it is referenced only by `HEAD`. We can
402402
of course add yet another commit in this state:
403403

404404
------------
@@ -416,7 +416,7 @@ a---b---c---d branch 'master' (refers to commit 'd')
416416
------------
417417

418418
In fact, we can perform all the normal Git operations. But, let's look
419-
at what happens when we then checkout master:
419+
at what happens when we then checkout `master`:
420420

421421
------------
422422
$ git checkout master
@@ -431,9 +431,9 @@ a---b---c---d branch 'master' (refers to commit 'd')
431431
------------
432432

433433
It is important to realize that at this point nothing refers to commit
434-
'f'. Eventually commit 'f' (and by extension commit 'e') will be deleted
434+
`f`. Eventually commit `f` (and by extension commit `e`) will be deleted
435435
by the routine Git garbage collection process, unless we create a reference
436-
before that happens. If we have not yet moved away from commit 'f',
436+
before that happens. If we have not yet moved away from commit `f`,
437437
any of these will create a reference to it:
438438

439439
------------
@@ -442,19 +442,19 @@ $ git branch foo <2>
442442
$ git tag foo <3>
443443
------------
444444

445-
<1> creates a new branch 'foo', which refers to commit 'f', and then
446-
updates HEAD to refer to branch 'foo'. In other words, we'll no longer
447-
be in detached HEAD state after this command.
445+
<1> creates a new branch `foo`, which refers to commit `f`, and then
446+
updates `HEAD` to refer to branch `foo`. In other words, we'll no longer
447+
be in detached `HEAD` state after this command.
448448

449-
<2> similarly creates a new branch 'foo', which refers to commit 'f',
450-
but leaves HEAD detached.
449+
<2> similarly creates a new branch `foo`, which refers to commit `f`,
450+
but leaves `HEAD` detached.
451451

452-
<3> creates a new tag 'foo', which refers to commit 'f',
453-
leaving HEAD detached.
452+
<3> creates a new tag `foo`, which refers to commit `f`,
453+
leaving `HEAD` detached.
454454

455-
If we have moved away from commit 'f', then we must first recover its object
455+
If we have moved away from commit `f`, then we must first recover its object
456456
name (typically by using git reflog), and then we can create a reference to
457-
it. For example, to see the last two commits to which HEAD referred, we
457+
it. For example, to see the last two commits to which `HEAD` referred, we
458458
can use either of these commands:
459459

460460
------------
@@ -465,20 +465,20 @@ $ git log -g -2 HEAD
465465
ARGUMENT DISAMBIGUATION
466466
-----------------------
467467

468-
When there is only one argument given and it is not `--` (e.g. "git
469-
checkout abc"), and when the argument is both a valid `<tree-ish>`
470-
(e.g. a branch "abc" exists) and a valid `<pathspec>` (e.g. a file
468+
When there is only one argument given and it is not `--` (e.g. `git
469+
checkout abc`), and when the argument is both a valid `<tree-ish>`
470+
(e.g. a branch `abc` exists) and a valid `<pathspec>` (e.g. a file
471471
or a directory whose name is "abc" exists), Git would usually ask
472472
you to disambiguate. Because checking out a branch is so common an
473-
operation, however, "git checkout abc" takes "abc" as a `<tree-ish>`
473+
operation, however, `git checkout abc` takes "abc" as a `<tree-ish>`
474474
in such a situation. Use `git checkout -- <pathspec>` if you want
475475
to checkout these paths out of the index.
476476

477477
EXAMPLES
478478
--------
479479

480480
. The following sequence checks out the `master` branch, reverts
481-
the `Makefile` to two revisions back, deletes hello.c by
481+
the `Makefile` to two revisions back, deletes `hello.c` by
482482
mistake, and gets it back from the index.
483483
+
484484
------------
@@ -490,7 +490,7 @@ $ git checkout hello.c <3>
490490
+
491491
<1> switch branch
492492
<2> take a file out of another commit
493-
<3> restore hello.c from the index
493+
<3> restore `hello.c` from the index
494494
+
495495
If you want to check out _all_ C source files out of the index,
496496
you can say
@@ -519,7 +519,7 @@ $ git checkout -- hello.c
519519
$ git checkout mytopic
520520
------------
521521
+
522-
However, your "wrong" branch and correct "mytopic" branch may
522+
However, your "wrong" branch and correct `mytopic` branch may
523523
differ in files that you have modified locally, in which case
524524
the above checkout would fail like this:
525525
+

0 commit comments

Comments
 (0)