Skip to content

Commit f69d2e6

Browse files
committed
doc: git-pull: move <repository> and <refspec> params
From user feedback: - it's confusing that we use both <branch> and <refspec> to refer to the second argument - one user is not clear about what `refs/heads/*:refs/remotes/origin/*` is meant to be an example of ("is it like a path?") The DESCRIPTION section is also doing a lot right now: it's trying to describe both how the <repository> and <refspec> arguments work (which is pretty complex, as seen in the DEFAULT BEHAVIOUR section) as well as how `git pull` calls `git fetch` and merge/rebase/etc depending on the arguments. Handle this by moving the description of the <repository> and <refspec> arguments to the OPTIONS section, so that we can focus on the merge/rebase/etc behaviour in the DESCRIPTION section, and refer folks to the later sections for details. Use the term "upstream" instead of 'the "remote" and "merge" configuration for the current branch' since users are more likely to know what an "upstream" is. Signed-off-by: Julia Evans <[email protected]>
1 parent ca2559c commit f69d2e6

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

Documentation/git-pull.adoc

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,6 @@ and then depending on configuration options or command line flags,
2727
will call either `git rebase` or `git merge` to reconcile diverging
2828
branches.
2929

30-
<repository> should be the name of a remote repository as
31-
passed to linkgit:git-fetch[1]. <refspec> can name an
32-
arbitrary remote ref (for example, the name of a tag) or even
33-
a collection of refs with corresponding remote-tracking branches
34-
(e.g., refs/heads/{asterisk}:refs/remotes/origin/{asterisk}),
35-
but usually it is the name of a branch in the remote repository.
36-
37-
Default values for <repository> and <branch> are read from the
38-
"remote" and "merge" configuration for the current branch
39-
as set by linkgit:git-branch[1] `--track`.
40-
4130
Assume the following history exists and the current branch is
4231
"`master`":
4332

@@ -77,6 +66,24 @@ pulling or stash them away with linkgit:git-stash[1].
7766
OPTIONS
7867
-------
7968

69+
<repository>::
70+
The "remote" repository to pull from. This can be either
71+
a URL (see the section <<URLS,GIT URLS>> below) or the name
72+
of a remote (see the section <<REMOTES,REMOTES>> below).
73+
+
74+
Defaults to the configured upstream for the current branch, or `origin`.
75+
See UPSTREAM BRANCHES below for more on how to configure upstreams.
76+
77+
<refspec>::
78+
Which branch or other reference(s) to fetch and integrate into the
79+
current branch, for example `main` in `git pull origin main`.
80+
Defaults to the configured upstream for the current branch.
81+
+
82+
This can be a branch, tag, or other collection of reference(s).
83+
See <refspec> below under "Options related to fetching" for the full syntax,
84+
and DEFAULT BEHAVIOUR below for how `git pull` uses this argument to
85+
determine which remote branch to integrate.
86+
8087
-q::
8188
--quiet::
8289
This is passed to both underlying git-fetch to squelch reporting of

0 commit comments

Comments
 (0)