blob: 3c9b4f9e09515d99d32a3d6dfa6603ef3a6f23b6 [file] [log] [blame]
Björn Gustavsson9c4a0362009-11-09 21:09:56 +01001--all::
2 Fetch all remotes.
3
Stephan Beyer32402402008-06-08 03:36:09 +02004-a::
5--append::
Jon Loeliger93d69d82005-11-06 23:30:56 -06006 Append ref names and object names of fetched refs to the
7 existing contents of `.git/FETCH_HEAD`. Without this
8 option old data in `.git/FETCH_HEAD` will be overwritten.
9
Jari Aalto6b276e12009-10-21 23:07:49 +030010--depth=<depth>::
Sebastian Schuberth60253a62016-01-08 10:32:52 +010011 Limit fetching to the specified number of commits from the tip of
12 each remote branch history. If fetching to a 'shallow' repository
13 created by `git clone` with `--depth=<depth>` option (see
14 linkgit:git-clone[1]), deepen or shorten the history to the specified
15 number of commits. Tags for the deepened commits are not fetched.
Michal Ostrowski2c620a12006-01-20 13:05:24 -050016
Nguyễn Thái Ngọc Duycccf74e2016-06-12 17:54:09 +070017--deepen=<depth>::
18 Similar to --depth, except it specifies the number of commits
19 from the current shallow boundary instead of from the tip of
20 each remote branch history.
21
Nguyễn Thái Ngọc Duy508ea882016-06-12 17:53:59 +070022--shallow-since=<date>::
23 Deepen or shorten the history of a shallow repository to
24 include all reachable commits after <date>.
25
Nguyễn Thái Ngọc Duya45a2602016-06-12 17:54:04 +070026--shallow-exclude=<revision>::
27 Deepen or shorten the history of a shallow repository to
28 exclude commits reachable from a specified remote branch or tag.
29 This option can be specified multiple times.
30
Nguyễn Thái Ngọc Duy4dcb1672013-01-11 16:05:46 +070031--unshallow::
Nguyễn Thái Ngọc Duy79d3a232013-12-05 20:02:41 +070032 If the source repository is complete, convert a shallow
33 repository to a complete one, removing all the limitations
34 imposed by shallow repositories.
35+
36If the source repository is shallow, fetch as much as possible so that
37the current repository has the same history as the source repository.
Nguyễn Thái Ngọc Duy4dcb1672013-01-11 16:05:46 +070038
Nguyễn Thái Ngọc Duy48d25ca2013-12-05 20:02:42 +070039--update-shallow::
40 By default when fetching from a shallow repository,
41 `git fetch` refuses refs that require updating
42 .git/shallow. This option updates .git/shallow and accept such
43 refs.
Jay Soffian28a15402009-11-10 09:19:43 +010044
Jonathan Tan3390e422018-07-02 15:39:44 -070045--negotiation-tip=<commit|glob>::
46 By default, Git will report, to the server, commits reachable
47 from all local refs to find common commits in an attempt to
48 reduce the size of the to-be-received packfile. If specified,
49 Git will only report commits reachable from the given tips.
50 This is useful to speed up fetches when the user knows which
51 local ref is likely to have commits in common with the
52 upstream ref being fetched.
53+
54This option may be specified more than once; if so, Git will report
55commits reachable from any of the given commits.
56+
57The argument to this option may be a glob on ref names, a ref, or the (possibly
58abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying
59this option multiple times, one for each matching ref name.
Ævar Arnfjörð Bjarmason52660822018-08-01 15:18:35 +000060+
61See also the `fetch.negotiationAlgorithm` configuration variable
62documented in linkgit:git-config[1].
Jonathan Tan3390e422018-07-02 15:39:44 -070063
Jay Soffian28a15402009-11-10 09:19:43 +010064ifndef::git-pull[]
65--dry-run::
66 Show what would be done, without making any changes.
67endif::git-pull[]
68
Stephan Beyer32402402008-06-08 03:36:09 +020069-f::
70--force::
Ævar Arnfjörð Bjarmasonae6a4702018-08-31 20:10:03 +000071 When 'git fetch' is used with `<src>:<dst>` refspec it may
72 refuse to update the local branch as discussed
73ifdef::git-pull[]
74 in the `<refspec>` part of the linkgit:git-fetch[1]
75 documentation.
76endif::git-pull[]
77ifndef::git-pull[]
78 in the `<refspec>` part below.
79endif::git-pull[]
80 This option overrides that check.
Jon Loeliger93d69d82005-11-06 23:30:56 -060081
Jari Aalto6b276e12009-10-21 23:07:49 +030082-k::
83--keep::
84 Keep downloaded pack.
85
Björn Gustavsson16679e32009-11-09 21:10:32 +010086ifndef::git-pull[]
87--multiple::
88 Allow several <repository> and <group> arguments to be
89 specified. No <refspec>s may be specified.
Jay Soffianf360d842009-11-10 09:15:47 +010090
Nguyễn Thái Ngọc Duyc3d6b702019-06-19 16:46:30 +070091--[no-]auto-gc::
92 Run `git gc --auto` at the end to perform garbage collection
93 if needed. This is enabled by default.
94
Oren Held1b79d1c2010-07-13 15:01:40 +030095-p::
Jay Soffianf360d842009-11-10 09:15:47 +010096--prune::
Jeff King9e702332016-06-13 19:58:51 -040097 Before fetching, remove any remote-tracking references that no
Michael Haggerty0838bf42013-10-30 06:33:00 +010098 longer exist on the remote. Tags are not subject to pruning
99 if they are fetched only because of the default tag
100 auto-following or due to a --tags option. However, if tags
101 are fetched due to an explicit refspec (either on the command
102 line or in the remote configuration, for example if the remote
103 was cloned with the --mirror option), then they are also
Ævar Arnfjörð Bjarmason97716d22018-02-09 20:32:15 +0000104 subject to pruning. Supplying `--prune-tags` is a shorthand for
105 providing the tag refspec.
106+
107See the PRUNING section below for more details.
108
109-P::
110--prune-tags::
111 Before fetching, remove any local tags that no longer exist on
112 the remote if `--prune` is enabled. This option should be used
113 more carefully, unlike `--prune` it will remove any local
114 references (local tags) that have been created. This option is
115 a shorthand for providing the explicit tag refspec along with
116 `--prune`, see the discussion about that in its documentation.
Ævar Arnfjörð Bjarmason627a1292018-02-09 20:32:13 +0000117+
118See the PRUNING section below for more details.
119
Björn Gustavsson16679e32009-11-09 21:10:32 +0100120endif::git-pull[]
121
Miklos Vajna10eb64f2008-01-25 10:17:38 +0000122ifndef::git-pull[]
Stephan Beyer32402402008-06-08 03:36:09 +0200123-n::
Miklos Vajna10eb64f2008-01-25 10:17:38 +0000124endif::git-pull[]
Michael Haggerty01ca90c2013-10-30 06:33:05 +0100125--no-tags::
Miklos Vajna10eb64f2008-01-25 10:17:38 +0000126 By default, tags that point at objects that are downloaded
127 from the remote repository are fetched and stored locally.
Daniel Johnsoned368542010-08-11 18:57:20 -0400128 This option disables this automatic tag following. The default
Nguyễn Thái Ngọc Duyda0005b2015-03-11 16:32:45 -0400129 behavior for a remote may be specified with the remote.<name>.tagOpt
Daniel Johnsoned368542010-08-11 18:57:20 -0400130 setting. See linkgit:git-config[1].
Junio C Hamano03febf92006-01-07 00:48:04 -0800131
Jens Lehmann2e5955f2010-11-03 21:55:48 +0100132ifndef::git-pull[]
Junio C Hamanoc5558f82014-05-29 15:21:31 -0700133--refmap=<refspec>::
134 When fetching refs listed on the command line, use the
135 specified refspec (can be given more than once) to map the
136 refs to remote-tracking branches, instead of the values of
137 `remote.*.fetch` configuration variables for the remote
138 repository. See section on "Configured Remote-tracking
139 Branches" for details.
140
Stephan Beyer32402402008-06-08 03:36:09 +0200141-t::
142--tags::
Michael Haggerty0838bf42013-10-30 06:33:00 +0100143 Fetch all tags from the remote (i.e., fetch remote tags
144 `refs/tags/*` into local tags with the same name), in addition
145 to whatever else would otherwise be fetched. Using this
146 option alone does not subject tags to pruning, even if --prune
147 is used (though tags may be pruned anyway if they are also the
Matthieu Moybcf96262016-06-28 13:40:11 +0200148 destination of an explicit refspec; see `--prune`).
Jon Loeliger93d69d82005-11-06 23:30:56 -0600149
Jens Lehmann8f0700d2011-03-06 23:11:21 +0100150--recurse-submodules[=yes|on-demand|no]::
151 This option controls if and under what conditions new commits of
152 populated submodules should be fetched too. It can be used as a
153 boolean option to completely disable recursion when set to 'no' or to
154 unconditionally recurse into all populated submodules when set to
155 'yes', which is the default when this option is used without any
156 value. Use 'on-demand' to only recurse into a populated submodule
157 when the superproject retrieves a commit that updates the submodule's
Jens Lehmannc16c3e42011-03-06 23:12:58 +0100158 reference to a commit that isn't already in the local submodule
159 clone.
Jens Lehmann8f0700d2011-03-06 23:11:21 +0100160
Stefan Beller62104ba2015-12-15 16:04:12 -0800161-j::
162--jobs=<n>::
163 Number of parallel children to be used for fetching submodules.
164 Each will fetch from different submodules, such that fetching many
165 submodules will be faster. By default submodules will be fetched
166 one at a time.
167
Jens Lehmann8f0700d2011-03-06 23:11:21 +0100168--no-recurse-submodules::
169 Disable recursive fetching of submodules (this has the same effect as
Matthieu Moybcf96262016-06-28 13:40:11 +0200170 using the `--recurse-submodules=no` option).
Jens Lehmann7dce19d2010-11-12 13:54:52 +0100171
Jens Lehmann7dce19d2010-11-12 13:54:52 +0100172--submodule-prefix=<path>::
173 Prepend <path> to paths printed in informative messages
174 such as "Fetching submodule foo". This option is used
175 internally when recursing over submodules.
Jens Lehmann88a21972011-03-06 23:10:46 +0100176
177--recurse-submodules-default=[yes|on-demand]::
178 This option is used internally to temporarily provide a
179 non-negative default value for the --recurse-submodules
180 option. All other methods of configuring fetch's submodule
181 recursion (such as settings in linkgit:gitmodules[5] and
182 linkgit:git-config[1]) override this option, as does
183 specifying --[no-]recurse-submodules directly.
Jens Lehmann7dce19d2010-11-12 13:54:52 +0100184endif::git-pull[]
185
Stephan Beyer32402402008-06-08 03:36:09 +0200186-u::
187--update-head-ok::
Thomas Rast0b444cd2010-01-10 00:33:00 +0100188 By default 'git fetch' refuses to update the head which
Jon Loeliger93d69d82005-11-06 23:30:56 -0600189 corresponds to the current branch. This flag disables the
Thomas Rast0b444cd2010-01-10 00:33:00 +0100190 check. This is purely for the internal use for 'git pull'
191 to communicate with 'git fetch', and unless you are
Junio C Hamanoa597fb02007-01-01 15:07:35 -0800192 implementing your own Porcelain you are not supposed to
193 use it.
Junio C Hamano03febf92006-01-07 00:48:04 -0800194
Jari Aalto6b276e12009-10-21 23:07:49 +0300195--upload-pack <upload-pack>::
196 When given, and the repository to fetch from is handled
Matthieu Moybcf96262016-06-28 13:40:11 +0200197 by 'git fetch-pack', `--exec=<upload-pack>` is passed to
Jari Aalto6b276e12009-10-21 23:07:49 +0300198 the command to specify non-default path for the command
199 run on the other end.
200
201ifndef::git-pull[]
202-q::
203--quiet::
204 Pass --quiet to git-fetch-pack and silence any other internally
Tay Ray Chuan98390182010-02-24 20:50:28 +0800205 used git commands. Progress is not reported to the standard error
206 stream.
Jari Aalto6b276e12009-10-21 23:07:49 +0300207
208-v::
209--verbose::
210 Be verbose.
211endif::git-pull[]
Tay Ray Chuan98390182010-02-24 20:50:28 +0800212
213--progress::
214 Progress status is reported on the standard error stream
215 by default when it is attached to a terminal, unless -q
216 is specified. This flag forces progress status even if the
217 standard error stream is not directed to a terminal.
Eric Wongc915f112016-02-03 04:09:14 +0000218
Brandon Williams5e3548e2018-04-23 15:46:24 -0700219-o <option>::
220--server-option=<option>::
221 Transmit the given string to the server when communicating using
222 protocol version 2. The given string must not contain a NUL or LF
Jonathan Tan6e983052019-04-12 12:51:22 -0700223 character. The server's handling of server options, including
224 unknown ones, is server-specific.
Brandon Williams5e3548e2018-04-23 15:46:24 -0700225 When multiple `--server-option=<option>` are given, they are all
226 sent to the other side in the order listed on the command line.
227
Derrick Stoleecdbd70c2019-06-18 13:25:26 -0700228--show-forced-updates::
229 By default, git checks if a branch is force-updated during
230 fetch. This can be disabled through fetch.showForcedUpdates, but
231 the --show-forced-updates option guarantees this check occurs.
232 See linkgit:git-config[1].
233
234--no-show-forced-updates::
235 By default, git checks if a branch is force-updated during
236 fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates
237 to false to skip this check for performance reasons. If used during
238 'git-pull' the --ff-only option will still check for forced updates
239 before attempting a fast-forward update. See linkgit:git-config[1].
240
Eric Wongc915f112016-02-03 04:09:14 +0000241-4::
242--ipv4::
243 Use IPv4 addresses only, ignoring IPv6 addresses.
244
245-6::
246--ipv6::
247 Use IPv6 addresses only, ignoring IPv4 addresses.