blob: 1ebbf1d738403204b77a6b18547de25e94ab28be [file] [log] [blame]
Junio C Hamano0c040942005-07-16 00:17:42 -07001<repository>::
Jon Loeligerbccf5952005-11-04 20:36:08 -06002 The "remote" repository that is the source of a fetch
John J. Franey58124732008-05-29 13:32:31 -04003 or pull operation. This parameter can be either a URL
4 (see the section <<URLS,GIT URLS>> below) or the name
5 of a remote (see the section <<REMOTES,REMOTES>> below).
Junio C Hamanoab9b3132005-08-24 16:23:08 -07006
Björn Gustavsson9c4a0362009-11-09 21:09:56 +01007ifndef::git-pull[]
8<group>::
9 A name referring to a list of repositories as the value
10 of remotes.<group> in the configuration file.
11 (See linkgit:git-config[1]).
12endif::git-pull[]
13
Junio C Hamanoab9b3132005-08-24 16:23:08 -070014<refspec>::
Marc Branchauddb4e4112014-06-11 10:24:04 -040015 Specifies which refs to fetch and which local refs to update.
16 When no <refspec>s appear on the command line, the refs to fetch
17 are read from `remote.<repository>.fetch` variables instead
18ifndef::git-pull[]
19 (see <<CRTB,CONFIGURED REMOTE-TRACKING BRANCHES>> below).
20endif::git-pull[]
21ifdef::git-pull[]
22 (see linkgit:git-fetch[1]).
23endif::git-pull[]
24+
25The format of a <refspec> parameter is an optional plus
26`+`, followed by the source ref <src>, followed
27by a colon `:`, followed by the destination ref <dst>.
28The colon can be omitted when <dst> is empty.
Jonas Fonsecadf8baa42005-10-03 19:16:30 +020029+
Junio C Hamano5cc32682014-05-29 13:22:01 -070030`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`;
31it requests fetching everything up to the given tag.
32+
J. Bruce Fields3598a302006-02-05 17:43:47 -050033The remote ref that matches <src>
Jonas Fonsecadf8baa42005-10-03 19:16:30 +020034is fetched, and if <dst> is not empty string, the local
Felipe Contrerasa75d7b52009-10-24 11:31:32 +030035ref that matches it is fast-forwarded using <src>.
Junio C Hamano7a0d9112009-01-25 22:25:20 -080036If the optional plus `+` is used, the local ref
Felipe Contrerasa75d7b52009-10-24 11:31:32 +030037is updated even if it does not result in a fast-forward
Jonas Fonsecadf8baa42005-10-03 19:16:30 +020038update.
39+
Jon Loeligerbccf5952005-11-04 20:36:08 -060040[NOTE]
Junio C Hamanof471dbc2014-05-29 12:53:28 -070041When the remote branch you want to fetch is known to
42be rewound and rebased regularly, it is expected that
43its new tip will not be descendant of its previous tip
44(as stored in your remote-tracking branch the last time
45you fetched). You would want
46to use the `+` sign to indicate non-fast-forward updates
47will be needed for such branches. There is no way to
48determine or declare that a branch will be made available
49in a repository with this behavior; the pulling user simply
Jon Loeligerbccf5952005-11-04 20:36:08 -060050must know this is the expected usage pattern for a branch.
Junio C Hamano5d59a322014-05-29 13:07:44 -070051ifdef::git-pull[]
Jon Loeligerbccf5952005-11-04 20:36:08 -060052+
53[NOTE]
Junio C Hamanofdd08972005-11-05 01:37:00 -080054There is a difference between listing multiple <refspec>
Thomas Rast0b444cd2010-01-10 00:33:00 +010055directly on 'git pull' command line and having multiple
Junio C Hamano5d59a322014-05-29 13:07:44 -070056`remote.<repository>.fetch` entries in your configuration
57for a <repository> and running a
Thomas Rast0b444cd2010-01-10 00:33:00 +010058'git pull' command without any explicit <refspec> parameters.
Junio C Hamano5d59a322014-05-29 13:07:44 -070059<refspec>s listed explicitly on the command line are always
Junio C Hamanofdd08972005-11-05 01:37:00 -080060merged into the current branch after fetching. In other words,
Junio C Hamano5d59a322014-05-29 13:07:44 -070061if you list more than one remote ref, 'git pull' will create
62an Octopus merge. On the other hand, if you do not list any
63explicit <refspec> parameter on the command line, 'git pull'
64will fetch all the <refspec>s it finds in the
65`remote.<repository>.fetch` configuration and merge
66only the first <refspec> found into the current branch.
67This is because making an
Junio C Hamanofdd08972005-11-05 01:37:00 -080068Octopus from remote refs is rarely done, while keeping track
69of multiple remote heads in one-go by fetching more than one
70is often useful.
Junio C Hamano5d59a322014-05-29 13:07:44 -070071endif::git-pull[]