Skip to content

Commit 7ced342

Browse files
committed
doc: convert git pull to synopsis style
- Switch 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 2f64d40 commit 7ced342

File tree

4 files changed

+38
-39
lines changed

4 files changed

+38
-39
lines changed

Documentation/fetch-options.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ configuration variables documented in linkgit:git-config[1], and the
7171

7272
`--negotiate-only`::
7373
Do not fetch anything from the server, and instead print the
74-
ancestors of the provided `--negotiation-tip=*` arguments,
74+
ancestors of the provided `--negotiation-tip=` arguments,
7575
which we have in common with the server.
7676
+
7777
This is incompatible with `--recurse-submodules=(yes|on-demand)`.
@@ -126,7 +126,7 @@ ifndef::git-pull[]
126126
`--auto-gc`::
127127
`--no-auto-gc`::
128128
Run `git maintenance run --auto` at the end to perform automatic
129-
repository maintenance if needed. (`--[no-]auto-gc` is a synonym.)
129+
repository maintenance if needed.
130130
This is enabled by default.
131131

132132
`--write-commit-graph`::
@@ -193,7 +193,7 @@ endif::git-pull[]
193193
specified refspec (can be given more than once) to map the
194194
refs to remote-tracking branches, instead of the values of
195195
`remote.<name>.fetch` configuration variables for the remote
196-
repository. Providing an empty `<refspec>` to the
196+
repository. Providing an empty _<refspec>_ to the
197197
`--refmap` option causes Git to ignore the configured
198198
refspecs and rely entirely on the refspecs supplied as
199199
command-line arguments. See section on "Configured Remote-tracking
@@ -204,7 +204,7 @@ endif::git-pull[]
204204
Fetch all tags from the remote (i.e., fetch remote tags
205205
`refs/tags/*` into local tags with the same name), in addition
206206
to whatever else would otherwise be fetched. Using this
207-
option alone does not subject tags to pruning, even if --prune
207+
option alone does not subject tags to pruning, even if `--prune`
208208
is used (though tags may be pruned anyway if they are also the
209209
destination of an explicit refspec; see `--prune`).
210210

@@ -306,7 +306,7 @@ endif::git-pull[]
306306
`-o <option>`::
307307
`--server-option=<option>`::
308308
Transmit the given string to the server when communicating using
309-
protocol version 2. The given string must not contain a NUL or LF
309+
protocol version 2. The given string must not contain a _NUL_ or _LF_
310310
character. The server's handling of server options, including
311311
unknown ones, is server-specific.
312312
When multiple `--server-option=<option>` are given, they are all

Documentation/git-pull.adoc

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ git-pull - Fetch from and integrate with another repository or a local branch
88

99
SYNOPSIS
1010
--------
11-
[verse]
12-
'git pull' [<options>] [<repository> [<refspec>...]]
11+
[synopsis]
12+
git pull [<options>] [<repository> [<refspec>...]]
1313

1414

1515
DESCRIPTION
@@ -43,7 +43,7 @@ want to handle, you can safely abort it with `git merge --abort` or `git
4343
OPTIONS
4444
-------
4545

46-
<repository>::
46+
_<repository>_::
4747
The "remote" repository to pull from. This can be either
4848
a URL (see the section <<URLS,GIT URLS>> below) or the name
4949
of a remote (see the section <<REMOTES,REMOTES>> below).
@@ -52,29 +52,29 @@ Defaults to the configured upstream for the current branch, or `origin`.
5252
See <<UPSTREAM-BRANCHES,UPSTREAM BRANCHES>> below for more on how to
5353
configure upstreams.
5454

55-
<refspec>::
55+
_<refspec>_::
5656
Which branch or other reference(s) to fetch and integrate into the
5757
current branch, for example `main` in `git pull origin main`.
5858
Defaults to the configured upstream for the current branch.
5959
+
6060
This can be a branch, tag, or other collection of reference(s).
61-
See <<fetch-refspec,<refspec>>> below under "Options related to fetching"
61+
See <<fetch-refspec,_<refspec>_>> below under "Options related to fetching"
6262
for the full syntax, and <<DEFAULT-BEHAVIOUR,DEFAULT BEHAVIOUR>> below
6363
for how `git pull` uses this argument to determine which remote branch
6464
to integrate.
6565

66-
-q::
67-
--quiet::
66+
`-q`::
67+
`--quiet`::
6868
This is passed to both underlying git-fetch to squelch reporting of
6969
during transfer, and underlying git-merge to squelch output during
7070
merging.
7171

72-
-v::
73-
--verbose::
74-
Pass --verbose to git-fetch and git-merge.
72+
`-v`::
73+
`--verbose`::
74+
Pass `--verbose` to git-fetch and git-merge.
7575

76-
--recurse-submodules[=(yes|on-demand|no)]::
77-
--no-recurse-submodules::
76+
`--recurse-submodules[=(yes|on-demand|no)]`::
77+
`--no-recurse-submodules`::
7878
This option controls if new commits of populated submodules should
7979
be fetched, and if the working trees of active submodules should be
8080
updated, too (see linkgit:git-fetch[1], linkgit:git-config[1] and
@@ -91,21 +91,20 @@ Options related to merging
9191

9292
include::merge-options.adoc[]
9393

94-
-r::
95-
--rebase[=(false|true|merges|interactive)]::
96-
When true, rebase the current branch on top of the upstream
94+
`-r`::
95+
`--rebase[=(true|merges|false|interactive)]`::
96+
`true`;; rebase the current branch on top of the upstream
9797
branch after fetching. If there is a remote-tracking branch
9898
corresponding to the upstream branch and the upstream branch
9999
was rebased since last fetched, the rebase uses that information
100-
to avoid rebasing non-local changes.
101-
+
102-
When set to `merges`, rebase using `git rebase --rebase-merges` so that
100+
to avoid rebasing non-local changes. This is the default.
101+
102+
`merges`;; rebase using `git rebase --rebase-merges` so that
103103
the local merge commits are included in the rebase (see
104104
linkgit:git-rebase[1] for details).
105-
+
106-
When false, merge the upstream branch into the current branch.
107-
+
108-
When `interactive`, enable the interactive mode of rebase.
105+
`false`;; merge the upstream branch into the current branch.
106+
`interactive`;; enable the interactive mode of rebase.
107+
109108
+
110109
See `pull.rebase`, `branch.<name>.rebase` and `branch.autoSetupRebase` in
111110
linkgit:git-config[1] if you want to make `git pull` always use
@@ -117,8 +116,8 @@ It rewrites history, which does not bode well when you
117116
published that history already. Do *not* use this option
118117
unless you have read linkgit:git-rebase[1] carefully.
119118

120-
--no-rebase::
121-
This is shorthand for --rebase=false.
119+
`--no-rebase`::
120+
This is shorthand for `--rebase=false`.
122121

123122
Options related to fetching
124123
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -178,7 +177,7 @@ uses the refspec from the configuration or
178177
rules apply:
179178

180179
. If `branch.<name>.merge` configuration for the current
181-
branch `<name>` exists, that is the name of the branch at the
180+
branch _<name>_ exists, that is the name of the branch at the
182181
remote site that is merged.
183182

184183
. If the refspec is a globbing one, nothing is merged.
@@ -198,17 +197,17 @@ $ git pull
198197
$ git pull origin
199198
------------------------------------------------
200199
+
201-
Normally the branch merged in is the HEAD of the remote repository,
202-
but the choice is determined by the branch.<name>.remote and
203-
branch.<name>.merge options; see linkgit:git-config[1] for details.
200+
Normally the branch merged in is the `HEAD` of the remote repository,
201+
but the choice is determined by the `branch.<name>.remote` and
202+
`branch.<name>.merge` options; see linkgit:git-config[1] for details.
204203
205204
* Merge into the current branch the remote branch `next`:
206205
+
207206
------------------------------------------------
208207
$ git pull origin next
209208
------------------------------------------------
210209
+
211-
This leaves a copy of `next` temporarily in FETCH_HEAD, and
210+
This leaves a copy of `next` temporarily in `FETCH_HEAD`, and
212211
updates the remote-tracking branch `origin/next`.
213212
The same can be done by invoking fetch and merge:
214213
+
@@ -219,14 +218,14 @@ $ git merge origin/next
219218
220219
221220
If you tried a pull which resulted in complex conflicts and
222-
would want to start over, you can recover with 'git reset'.
221+
would want to start over, you can recover with `git reset`.
223222

224223

225224
include::transfer-data-leaks.adoc[]
226225

227226
BUGS
228227
----
229-
Using --recurse-submodules can only fetch new commits in already checked
228+
Using `--recurse-submodules` can only fetch new commits in already checked
230229
out submodules right now. When e.g. upstream added a new submodule in the
231230
just fetched commits of the superproject the submodule itself cannot be
232231
fetched, making it impossible to check out that submodule later without

Documentation/merge-options.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ ifdef::git-pull[]
5656
`--ff-only`::
5757
Only update to the new history if there is no divergent local
5858
history. This is the default when no method for reconciling
59-
divergent histories is provided (via the --rebase=* flags).
59+
divergent histories is provided (via the `--rebase` flags).
6060

6161
`--ff`::
6262
`--no-ff`::

Documentation/urls-remotes.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ _<URL>_ is required; `#<head>` is optional.
7676

7777
Depending on the operation, git will use one of the following
7878
refspecs, if you don't provide one on the command line.
79-
_<branch> is the name of this file in `$GIT_DIR/branches` and
79+
_<branch>_ is the name of this file in `$GIT_DIR/branches` and
8080
_<head>_ defaults to `master`.
8181

8282
git fetch uses:
@@ -111,7 +111,7 @@ Git defaults to using the upstream branch for remote operations, for example:
111111
'origin/main' have diverged, and have 2 and 3 different commits each
112112
respectively".
113113
114-
The upstream is stored in `.git/config`, in the "remote" and "merge"
114+
The upstream is stored in `.git/config`, in the "`remote`" and "`merge`"
115115
fields. For example, if `main`'s upstream is `origin/main`:
116116
117117
------------

0 commit comments

Comments
 (0)