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 <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jean-Noël Avila
2025-11-19 21:40:03 +00:00
committed by Junio C Hamano
parent 903b04a3e7
commit c80a5ebce0
4 changed files with 38 additions and 39 deletions

View File

@@ -71,7 +71,7 @@ configuration variables documented in linkgit:git-config[1], and the
`--negotiate-only`:: `--negotiate-only`::
Do not fetch anything from the server, and instead print the Do not fetch anything from the server, and instead print the
ancestors of the provided `--negotiation-tip=*` arguments, ancestors of the provided `--negotiation-tip=` arguments,
which we have in common with the server. which we have in common with the server.
+ +
This is incompatible with `--recurse-submodules=(yes|on-demand)`. This is incompatible with `--recurse-submodules=(yes|on-demand)`.
@@ -126,7 +126,7 @@ ifndef::git-pull[]
`--auto-gc`:: `--auto-gc`::
`--no-auto-gc`:: `--no-auto-gc`::
Run `git maintenance run --auto` at the end to perform automatic Run `git maintenance run --auto` at the end to perform automatic
repository maintenance if needed. (`--[no-]auto-gc` is a synonym.) repository maintenance if needed.
This is enabled by default. This is enabled by default.
`--write-commit-graph`:: `--write-commit-graph`::
@@ -193,7 +193,7 @@ endif::git-pull[]
specified refspec (can be given more than once) to map the specified refspec (can be given more than once) to map the
refs to remote-tracking branches, instead of the values of refs to remote-tracking branches, instead of the values of
`remote.<name>.fetch` configuration variables for the remote `remote.<name>.fetch` configuration variables for the remote
repository. Providing an empty `<refspec>` to the repository. Providing an empty _<refspec>_ to the
`--refmap` option causes Git to ignore the configured `--refmap` option causes Git to ignore the configured
refspecs and rely entirely on the refspecs supplied as refspecs and rely entirely on the refspecs supplied as
command-line arguments. See section on "Configured Remote-tracking command-line arguments. See section on "Configured Remote-tracking
@@ -204,7 +204,7 @@ endif::git-pull[]
Fetch all tags from the remote (i.e., fetch remote tags Fetch all tags from the remote (i.e., fetch remote tags
`refs/tags/*` into local tags with the same name), in addition `refs/tags/*` into local tags with the same name), in addition
to whatever else would otherwise be fetched. Using this to whatever else would otherwise be fetched. Using this
option alone does not subject tags to pruning, even if --prune option alone does not subject tags to pruning, even if `--prune`
is used (though tags may be pruned anyway if they are also the is used (though tags may be pruned anyway if they are also the
destination of an explicit refspec; see `--prune`). destination of an explicit refspec; see `--prune`).
@@ -306,7 +306,7 @@ endif::git-pull[]
`-o <option>`:: `-o <option>`::
`--server-option=<option>`:: `--server-option=<option>`::
Transmit the given string to the server when communicating using Transmit the given string to the server when communicating using
protocol version 2. The given string must not contain a NUL or LF protocol version 2. The given string must not contain a _NUL_ or _LF_
character. The server's handling of server options, including character. The server's handling of server options, including
unknown ones, is server-specific. unknown ones, is server-specific.
When multiple `--server-option=<option>` are given, they are all When multiple `--server-option=<option>` are given, they are all

View File

@@ -8,8 +8,8 @@ git-pull - Fetch from and integrate with another repository or a local branch
SYNOPSIS SYNOPSIS
-------- --------
[verse] [synopsis]
'git pull' [<options>] [<repository> [<refspec>...]] git pull [<options>] [<repository> [<refspec>...]]
DESCRIPTION DESCRIPTION
@@ -43,7 +43,7 @@ want to handle, you can safely abort it with `git merge --abort` or `git
OPTIONS OPTIONS
------- -------
<repository>:: _<repository>_::
The "remote" repository to pull from. This can be either The "remote" repository to pull from. This can be either
a URL (see the section <<URLS,GIT URLS>> below) or the name a URL (see the section <<URLS,GIT URLS>> below) or the name
of a remote (see the section <<REMOTES,REMOTES>> below). of a remote (see the section <<REMOTES,REMOTES>> below).
@@ -52,29 +52,29 @@ Defaults to the configured upstream for the current branch, or `origin`.
See <<UPSTREAM-BRANCHES,UPSTREAM BRANCHES>> below for more on how to See <<UPSTREAM-BRANCHES,UPSTREAM BRANCHES>> below for more on how to
configure upstreams. configure upstreams.
<refspec>:: _<refspec>_::
Which branch or other reference(s) to fetch and integrate into the Which branch or other reference(s) to fetch and integrate into the
current branch, for example `main` in `git pull origin main`. current branch, for example `main` in `git pull origin main`.
Defaults to the configured upstream for the current branch. Defaults to the configured upstream for the current branch.
+ +
This can be a branch, tag, or other collection of reference(s). This can be a branch, tag, or other collection of reference(s).
See <<fetch-refspec,<refspec>>> below under "Options related to fetching" See <<fetch-refspec,_<refspec>_>> below under "Options related to fetching"
for the full syntax, and <<DEFAULT-BEHAVIOUR,DEFAULT BEHAVIOUR>> below for the full syntax, and <<DEFAULT-BEHAVIOUR,DEFAULT BEHAVIOUR>> below
for how `git pull` uses this argument to determine which remote branch for how `git pull` uses this argument to determine which remote branch
to integrate. to integrate.
-q:: `-q`::
--quiet:: `--quiet`::
This is passed to both underlying git-fetch to squelch reporting of This is passed to both underlying git-fetch to squelch reporting of
during transfer, and underlying git-merge to squelch output during during transfer, and underlying git-merge to squelch output during
merging. merging.
-v:: `-v`::
--verbose:: `--verbose`::
Pass --verbose to git-fetch and git-merge. Pass `--verbose` to git-fetch and git-merge.
--recurse-submodules[=(yes|on-demand|no)]:: `--recurse-submodules[=(yes|on-demand|no)]`::
--no-recurse-submodules:: `--no-recurse-submodules`::
This option controls if new commits of populated submodules should This option controls if new commits of populated submodules should
be fetched, and if the working trees of active submodules should be be fetched, and if the working trees of active submodules should be
updated, too (see linkgit:git-fetch[1], linkgit:git-config[1] and updated, too (see linkgit:git-fetch[1], linkgit:git-config[1] and
@@ -91,21 +91,20 @@ Options related to merging
include::merge-options.adoc[] include::merge-options.adoc[]
-r:: `-r`::
--rebase[=(false|true|merges|interactive)]:: `--rebase[=(true|merges|false|interactive)]`::
When true, rebase the current branch on top of the upstream `true`;; rebase the current branch on top of the upstream
branch after fetching. If there is a remote-tracking branch branch after fetching. If there is a remote-tracking branch
corresponding to the upstream branch and the upstream branch corresponding to the upstream branch and the upstream branch
was rebased since last fetched, the rebase uses that information was rebased since last fetched, the rebase uses that information
to avoid rebasing non-local changes. to avoid rebasing non-local changes. This is the default.
+
When set to `merges`, rebase using `git rebase --rebase-merges` so that `merges`;; rebase using `git rebase --rebase-merges` so that
the local merge commits are included in the rebase (see the local merge commits are included in the rebase (see
linkgit:git-rebase[1] for details). linkgit:git-rebase[1] for details).
+ `false`;; merge the upstream branch into the current branch.
When false, merge the upstream branch into the current branch. `interactive`;; enable the interactive mode of rebase.
+
When `interactive`, enable the interactive mode of rebase.
+ +
See `pull.rebase`, `branch.<name>.rebase` and `branch.autoSetupRebase` in See `pull.rebase`, `branch.<name>.rebase` and `branch.autoSetupRebase` in
linkgit:git-config[1] if you want to make `git pull` always use 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
published that history already. Do *not* use this option published that history already. Do *not* use this option
unless you have read linkgit:git-rebase[1] carefully. unless you have read linkgit:git-rebase[1] carefully.
--no-rebase:: `--no-rebase`::
This is shorthand for --rebase=false. This is shorthand for `--rebase=false`.
Options related to fetching Options related to fetching
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -178,7 +177,7 @@ uses the refspec from the configuration or
rules apply: rules apply:
. If `branch.<name>.merge` configuration for the current . If `branch.<name>.merge` configuration for the current
branch `<name>` exists, that is the name of the branch at the branch _<name>_ exists, that is the name of the branch at the
remote site that is merged. remote site that is merged.
. If the refspec is a globbing one, nothing is merged. . If the refspec is a globbing one, nothing is merged.
@@ -198,9 +197,9 @@ $ git pull
$ git pull origin $ git pull origin
------------------------------------------------ ------------------------------------------------
+ +
Normally the branch merged in is the HEAD of the remote repository, Normally the branch merged in is the `HEAD` of the remote repository,
but the choice is determined by the branch.<name>.remote and but the choice is determined by the `branch.<name>.remote` and
branch.<name>.merge options; see linkgit:git-config[1] for details. `branch.<name>.merge` options; see linkgit:git-config[1] for details.
* Merge into the current branch the remote branch `next`: * Merge into the current branch the remote branch `next`:
+ +
@@ -208,7 +207,7 @@ branch.<name>.merge options; see linkgit:git-config[1] for details.
$ git pull origin next $ git pull origin next
------------------------------------------------ ------------------------------------------------
+ +
This leaves a copy of `next` temporarily in FETCH_HEAD, and This leaves a copy of `next` temporarily in `FETCH_HEAD`, and
updates the remote-tracking branch `origin/next`. updates the remote-tracking branch `origin/next`.
The same can be done by invoking fetch and merge: The same can be done by invoking fetch and merge:
+ +
@@ -219,14 +218,14 @@ $ git merge origin/next
If you tried a pull which resulted in complex conflicts and If you tried a pull which resulted in complex conflicts and
would want to start over, you can recover with 'git reset'. would want to start over, you can recover with `git reset`.
include::transfer-data-leaks.adoc[] include::transfer-data-leaks.adoc[]
BUGS BUGS
---- ----
Using --recurse-submodules can only fetch new commits in already checked Using `--recurse-submodules` can only fetch new commits in already checked
out submodules right now. When e.g. upstream added a new submodule in the out submodules right now. When e.g. upstream added a new submodule in the
just fetched commits of the superproject the submodule itself cannot be just fetched commits of the superproject the submodule itself cannot be
fetched, making it impossible to check out that submodule later without fetched, making it impossible to check out that submodule later without

View File

@@ -56,7 +56,7 @@ ifdef::git-pull[]
`--ff-only`:: `--ff-only`::
Only update to the new history if there is no divergent local Only update to the new history if there is no divergent local
history. This is the default when no method for reconciling history. This is the default when no method for reconciling
divergent histories is provided (via the --rebase=* flags). divergent histories is provided (via the `--rebase` flags).
`--ff`:: `--ff`::
`--no-ff`:: `--no-ff`::

View File

@@ -76,7 +76,7 @@ _<URL>_ is required; `#<head>` is optional.
Depending on the operation, git will use one of the following Depending on the operation, git will use one of the following
refspecs, if you don't provide one on the command line. refspecs, if you don't provide one on the command line.
_<branch> is the name of this file in `$GIT_DIR/branches` and _<branch>_ is the name of this file in `$GIT_DIR/branches` and
_<head>_ defaults to `master`. _<head>_ defaults to `master`.
git fetch uses: git fetch uses:
@@ -111,7 +111,7 @@ Git defaults to using the upstream branch for remote operations, for example:
'origin/main' have diverged, and have 2 and 3 different commits each 'origin/main' have diverged, and have 2 and 3 different commits each
respectively". respectively".
The upstream is stored in `.git/config`, in the "remote" and "merge" The upstream is stored in `.git/config`, in the "`remote`" and "`merge`"
fields. For example, if `main`'s upstream is `origin/main`: fields. For example, if `main`'s upstream is `origin/main`:
------------ ------------