Skip to content

Commit 424ddb9

Browse files
committed
doc: git-restore: migrate to new style format
The git-restore manpage was converted to the new documentation format: - switching the synopsis to a 'synopsis' block which will automatically format placeholders in italics and keywords in monospace - use _<placeholder>_ instead of <placeholder> in the description - use `backticks for keywords and more complex option descriptions`. The new rendering engine will apply synopsis rules to these spans. Signed-off-by: Jean-Noël Avila <[email protected]>
1 parent 1b4e9a5 commit 424ddb9

File tree

1 file changed

+54
-55
lines changed

1 file changed

+54
-55
lines changed

Documentation/git-restore.txt

Lines changed: 54 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ git-restore - Restore working tree files
77

88
SYNOPSIS
99
--------
10-
[verse]
11-
'git restore' [<options>] [--source=<tree>] [--staged] [--worktree] [--] <pathspec>...
12-
'git restore' [<options>] [--source=<tree>] [--staged] [--worktree] --pathspec-from-file=<file> [--pathspec-file-nul]
13-
'git restore' (-p|--patch) [<options>] [--source=<tree>] [--staged] [--worktree] [--] [<pathspec>...]
10+
[synopsis]
11+
git restore [<options>] [--source=<tree>] [--staged] [--worktree] [--] <pathspec>...
12+
git restore [<options>] [--source=<tree>] [--staged] [--worktree] --pathspec-from-file=<file> [--pathspec-file-nul]
13+
git restore (-p|--patch) [<options>] [--source=<tree>] [--staged] [--worktree] [--] [<pathspec>...]
1414

1515
DESCRIPTION
1616
-----------
@@ -32,88 +32,88 @@ THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
3232

3333
OPTIONS
3434
-------
35-
-s <tree>::
36-
--source=<tree>::
35+
`-s <tree>`::
36+
`--source=<tree>`::
3737
Restore the working tree files with the content from the given
3838
tree. It is common to specify the source tree by naming a
3939
commit, branch or tag associated with it.
4040
+
4141
If not specified, the contents are restored from `HEAD` if `--staged` is
4242
given, otherwise from the index.
4343
+
44-
As a special case, you may use `"A...B"` as a shortcut for the
45-
merge base of `A` and `B` if there is exactly one merge base. You can
46-
leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
44+
As a special case, you may use `"<refA>...<refB>"` as a shortcut for the
45+
merge base of _<refA>_ and _<refB>_ if there is exactly one merge base. You can
46+
leave out at most one of _<refA>__ and _<refB>_, in which case it defaults to `HEAD`.
4747

48-
-p::
49-
--patch::
48+
`-p`::
49+
`--patch`::
5050
Interactively select hunks in the difference between the
51-
restore source and the restore location. See the ``Interactive
52-
Mode'' section of linkgit:git-add[1] to learn how to operate
51+
restore source and the restore location. See the "Interactive
52+
Mode" section of linkgit:git-add[1] to learn how to operate
5353
the `--patch` mode.
5454
+
5555
Note that `--patch` can accept no pathspec and will prompt to restore
5656
all modified paths.
5757

58-
-W::
59-
--worktree::
60-
-S::
61-
--staged::
58+
`-W`::
59+
`--worktree`::
60+
`-S`::
61+
`--staged`::
6262
Specify the restore location. If neither option is specified,
6363
by default the working tree is restored. Specifying `--staged`
6464
will only restore the index. Specifying both restores both.
6565

66-
-q::
67-
--quiet::
66+
`-q`::
67+
`--quiet`::
6868
Quiet, suppress feedback messages. Implies `--no-progress`.
6969

70-
--progress::
71-
--no-progress::
70+
`--progress`::
71+
`--no-progress`::
7272
Progress status is reported on the standard error stream
7373
by default when it is attached to a terminal, unless `--quiet`
7474
is specified. This flag enables progress reporting even if not
7575
attached to a terminal, regardless of `--quiet`.
7676

77-
--ours::
78-
--theirs::
77+
`--ours`::
78+
`--theirs`::
7979
When restoring files in the working tree from the index, use
80-
stage #2 ('ours') or #3 ('theirs') for unmerged paths.
80+
stage #2 (`ours`) or #3 (`theirs`) for unmerged paths.
8181
This option cannot be used when checking out paths from a
8282
tree-ish (i.e. with the `--source` option).
8383
+
84-
Note that during `git rebase` and `git pull --rebase`, 'ours' and
85-
'theirs' may appear swapped. See the explanation of the same options
84+
Note that during `git rebase` and `git pull --rebase`, `ours` and
85+
`theirs` may appear swapped. See the explanation of the same options
8686
in linkgit:git-checkout[1] for details.
8787

88-
-m::
89-
--merge::
88+
`-m`::
89+
`--merge`::
9090
When restoring files on the working tree from the index,
9191
recreate the conflicted merge in the unmerged paths.
9292
This option cannot be used when checking out paths from a
9393
tree-ish (i.e. with the `--source` option).
9494

95-
--conflict=<style>::
95+
`--conflict=<style>`::
9696
The same as `--merge` option above, but changes the way the
9797
conflicting hunks are presented, overriding the
9898
`merge.conflictStyle` configuration variable. Possible values
99-
are "merge" (default), "diff3", and "zdiff3".
99+
are `merge` (default), `diff3`, and `zdiff3`.
100100

101-
--ignore-unmerged::
101+
`--ignore-unmerged`::
102102
When restoring files on the working tree from the index, do
103103
not abort the operation if there are unmerged entries and
104104
neither `--ours`, `--theirs`, `--merge` or `--conflict` is
105105
specified. Unmerged paths on the working tree are left alone.
106106

107-
--ignore-skip-worktree-bits::
107+
`--ignore-skip-worktree-bits`::
108108
In sparse checkout mode, the default is to only update entries
109-
matched by `<pathspec>` and sparse patterns in
110-
$GIT_DIR/info/sparse-checkout. This option ignores the sparse
109+
matched by _<pathspec>_ and sparse patterns in
110+
`$GIT_DIR/info/sparse-checkout`. This option ignores the sparse
111111
patterns and unconditionally restores any files in
112-
`<pathspec>`.
112+
_<pathspec>_.
113113

114-
--recurse-submodules::
115-
--no-recurse-submodules::
116-
If `<pathspec>` names an active submodule and the restore location
114+
`--recurse-submodules`::
115+
`--no-recurse-submodules`::
116+
If _<pathspec>_ names an active submodule and the restore location
117117
includes the working tree, the submodule will only be updated if
118118
this option is given, in which case its working tree will be
119119
restored to the commit recorded in the superproject, and any local
@@ -122,30 +122,29 @@ in linkgit:git-checkout[1] for details.
122122
not be updated. Just like linkgit:git-checkout[1], this will detach
123123
`HEAD` of the submodule.
124124

125-
--overlay::
126-
--no-overlay::
127-
In overlay mode, the command never removes files when
128-
restoring. In no-overlay mode, tracked files that do not
129-
appear in the `--source` tree are removed, to make them match
130-
`<tree>` exactly. The default is no-overlay mode.
131-
132-
--pathspec-from-file=<file>::
133-
Pathspec is passed in `<file>` instead of commandline args. If
134-
`<file>` is exactly `-` then standard input is used. Pathspec
135-
elements are separated by LF or CR/LF. Pathspec elements can be
125+
`--overlay`::
126+
`--no-overlay`::
127+
In overlay mode, never remove files when restoring. In no-overlay mode,
128+
remove tracked files that do not appear in the `--source` tree, to make
129+
them match _<tree>_ exactly. The default is no-overlay mode.
130+
131+
`--pathspec-from-file=<file>`::
132+
Pathspec is passed in _<file>_ instead of commandline args. If
133+
_<file>_ is exactly `-` then standard input is used. Pathspec
134+
elements are separated by _LF_ or _CR_/_LF_. Pathspec elements can be
136135
quoted as explained for the configuration variable `core.quotePath`
137136
(see linkgit:git-config[1]). See also `--pathspec-file-nul` and
138137
global `--literal-pathspecs`.
139138

140-
--pathspec-file-nul::
139+
`--pathspec-file-nul`::
141140
Only meaningful with `--pathspec-from-file`. Pathspec elements are
142-
separated with NUL character and all other characters are taken
141+
separated with _NUL_ character and all other characters are taken
143142
literally (including newlines and quotes).
144143

145-
\--::
144+
`--`::
146145
Do not interpret any more arguments as options.
147146

148-
<pathspec>...::
147+
`<pathspec>...`::
149148
Limits the paths affected by the operation.
150149
+
151150
For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
@@ -154,7 +153,7 @@ EXAMPLES
154153
--------
155154

156155
The following sequence switches to the `master` branch, reverts the
157-
`Makefile` to two revisions back, deletes hello.c by mistake, and gets
156+
`Makefile` to two revisions back, deletes `hello.c` by mistake, and gets
158157
it back from the index.
159158

160159
------------
@@ -165,7 +164,7 @@ $ git restore hello.c <2>
165164
------------
166165

167166
<1> take a file out of another commit
168-
<2> restore hello.c from the index
167+
<2> restore `hello.c` from the index
169168

170169
If you want to restore _all_ C source files to match the version in
171170
the index, you can say

0 commit comments

Comments
 (0)