2 Fetch all remotes, except for the ones that has the
3 `remote.<name>.skipFetchAll` configuration variable set.
4 This overrides the configuration variable fetch.all`.
8 Append ref names and object names of fetched refs to the
9 existing contents of `.git/FETCH_HEAD`. Without this
10 option old data in `.git/FETCH_HEAD` will be overwritten.
13 Use an atomic transaction to update local refs. Either all refs are
14 updated, or on error, no refs are updated.
17 Limit fetching to the specified number of commits from the tip of
18 each remote branch history. If fetching to a 'shallow' repository
19 created by `git clone` with `--depth=<depth>` option (see
20 linkgit:git-clone[1]), deepen or shorten the history to the specified
21 number of commits. Tags for the deepened commits are not fetched.
24 Similar to --depth, except it specifies the number of commits
25 from the current shallow boundary instead of from the tip of
26 each remote branch history.
28 --shallow-since=<date>::
29 Deepen or shorten the history of a shallow repository to
30 include all reachable commits after <date>.
32 --shallow-exclude=<ref>::
33 Deepen or shorten the history of a shallow repository to
34 exclude commits reachable from a specified remote branch or tag.
35 This option can be specified multiple times.
38 If the source repository is complete, convert a shallow
39 repository to a complete one, removing all the limitations
40 imposed by shallow repositories.
42 If the source repository is shallow, fetch as much as possible so that
43 the current repository has the same history as the source repository.
46 By default when fetching from a shallow repository,
47 `git fetch` refuses refs that require updating
48 .git/shallow. This option updates .git/shallow and accepts such
51 --negotiation-tip=<commit|glob>::
52 By default, Git will report, to the server, commits reachable
53 from all local refs to find common commits in an attempt to
54 reduce the size of the to-be-received packfile. If specified,
55 Git will only report commits reachable from the given tips.
56 This is useful to speed up fetches when the user knows which
57 local ref is likely to have commits in common with the
58 upstream ref being fetched.
60 This option may be specified more than once; if so, Git will report
61 commits reachable from any of the given commits.
63 The argument to this option may be a glob on ref names, a ref, or the (possibly
64 abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying
65 this option multiple times, one for each matching ref name.
67 See also the `fetch.negotiationAlgorithm` and `push.negotiate`
68 configuration variables documented in linkgit:git-config[1], and the
69 `--negotiate-only` option below.
72 Do not fetch anything from the server, and instead print the
73 ancestors of the provided `--negotiation-tip=*` arguments,
74 which we have in common with the server.
76 This is incompatible with `--recurse-submodules=[yes|on-demand]`.
77 Internally this is used to implement the `push.negotiate` option, see
78 linkgit:git-config[1].
81 Show what would be done, without making any changes.
84 Print the output to standard output in an easy-to-parse format for
85 scripts. See section OUTPUT in linkgit:git-fetch[1] for details.
87 This is incompatible with `--recurse-submodules=[yes|on-demand]` and takes
88 precedence over the `fetch.output` config option.
91 --[no-]write-fetch-head::
92 Write the list of remote refs fetched in the `FETCH_HEAD`
93 file directly under `$GIT_DIR`. This is the default.
94 Passing `--no-write-fetch-head` from the command line tells
95 Git not to write the file. Under `--dry-run` option, the
96 file is never written.
101 When 'git fetch' is used with `<src>:<dst>` refspec, it may
102 refuse to update the local branch as discussed
104 in the `<refspec>` part of the linkgit:git-fetch[1]
108 in the `<refspec>` part below.
110 This option overrides that check.
114 Keep downloaded pack.
118 Allow several <repository> and <group> arguments to be
119 specified. No <refspec>s may be specified.
121 --[no-]auto-maintenance::
123 Run `git maintenance run --auto` at the end to perform automatic
124 repository maintenance if needed. (`--[no-]auto-gc` is a synonym.)
125 This is enabled by default.
127 --[no-]write-commit-graph::
128 Write a commit-graph after fetching. This overrides the config
129 setting `fetch.writeCommitGraph`.
133 Modify the configured refspec to place all refs into the
134 `refs/prefetch/` namespace. See the `prefetch` task in
135 linkgit:git-maintenance[1].
139 Before fetching, remove any remote-tracking references that no
140 longer exist on the remote. Tags are not subject to pruning
141 if they are fetched only because of the default tag
142 auto-following or due to a --tags option. However, if tags
143 are fetched due to an explicit refspec (either on the command
144 line or in the remote configuration, for example if the remote
145 was cloned with the --mirror option), then they are also
146 subject to pruning. Supplying `--prune-tags` is a shorthand for
147 providing the tag refspec.
150 See the PRUNING section below for more details.
154 Before fetching, remove any local tags that no longer exist on
155 the remote if `--prune` is enabled. This option should be used
156 more carefully, unlike `--prune` it will remove any local
157 references (local tags) that have been created. This option is
158 a shorthand for providing the explicit tag refspec along with
159 `--prune`, see the discussion about that in its documentation.
161 See the PRUNING section below for more details.
169 By default, tags that point at objects that are downloaded
170 from the remote repository are fetched and stored locally.
171 This option disables this automatic tag following. The default
172 behavior for a remote may be specified with the remote.<name>.tagOpt
173 setting. See linkgit:git-config[1].
177 Instead of negotiating with the server to avoid transferring commits and
178 associated objects that are already present locally, this option fetches
179 all objects as a fresh clone would. Use this to reapply a partial clone
180 filter from configuration or using `--filter=` when the filter
181 definition has changed. Automatic post-fetch maintenance will perform
182 object database pack consolidation to remove any duplicate objects.
186 When fetching refs listed on the command line, use the
187 specified refspec (can be given more than once) to map the
188 refs to remote-tracking branches, instead of the values of
189 `remote.*.fetch` configuration variables for the remote
190 repository. Providing an empty `<refspec>` to the
191 `--refmap` option causes Git to ignore the configured
192 refspecs and rely entirely on the refspecs supplied as
193 command-line arguments. See section on "Configured Remote-tracking
194 Branches" for details.
198 Fetch all tags from the remote (i.e., fetch remote tags
199 `refs/tags/*` into local tags with the same name), in addition
200 to whatever else would otherwise be fetched. Using this
201 option alone does not subject tags to pruning, even if --prune
202 is used (though tags may be pruned anyway if they are also the
203 destination of an explicit refspec; see `--prune`).
206 --recurse-submodules[=(yes|on-demand|no)]::
207 This option controls if and under what conditions new commits of
208 submodules should be fetched too. When recursing through submodules,
209 `git fetch` always attempts to fetch "changed" submodules, that is, a
210 submodule that has commits that are referenced by a newly fetched
211 superproject commit but are missing in the local submodule clone. A
212 changed submodule can be fetched as long as it is present locally e.g.
213 in `$GIT_DIR/modules/` (see linkgit:gitsubmodules[7]); if the upstream
214 adds a new submodule, that submodule cannot be fetched until it is
215 cloned e.g. by `git submodule update`.
217 When set to 'on-demand', only changed submodules are fetched. When set
218 to 'yes', all populated submodules are fetched and submodules that are
219 both unpopulated and changed are fetched. When set to 'no', submodules
222 When unspecified, this uses the value of `fetch.recurseSubmodules` if it
223 is set (see linkgit:git-config[1]), defaulting to 'on-demand' if unset.
224 When this option is used without any value, it defaults to 'yes'.
229 Number of parallel children to be used for all forms of fetching.
231 If the `--multiple` option was specified, the different remotes will be fetched
232 in parallel. If multiple submodules are fetched, they will be fetched in
233 parallel. To control them independently, use the config settings
234 `fetch.parallel` and `submodule.fetchJobs` (see linkgit:git-config[1]).
236 Typically, parallel recursive and multi-remote fetches will be faster. By
237 default fetches are performed sequentially, not in parallel.
240 --no-recurse-submodules::
241 Disable recursive fetching of submodules (this has the same effect as
242 using the `--recurse-submodules=no` option).
246 If the remote is fetched successfully, add upstream
247 (tracking) reference, used by argument-less
248 linkgit:git-pull[1] and other commands. For more information,
249 see `branch.<name>.merge` and `branch.<name>.remote` in
250 linkgit:git-config[1].
253 --submodule-prefix=<path>::
254 Prepend <path> to paths printed in informative messages
255 such as "Fetching submodule foo". This option is used
256 internally when recursing over submodules.
258 --recurse-submodules-default=[yes|on-demand]::
259 This option is used internally to temporarily provide a
260 non-negative default value for the --recurse-submodules
261 option. All other methods of configuring fetch's submodule
262 recursion (such as settings in linkgit:gitmodules[5] and
263 linkgit:git-config[1]) override this option, as does
264 specifying --[no-]recurse-submodules directly.
268 By default 'git fetch' refuses to update the head which
269 corresponds to the current branch. This flag disables the
270 check. This is purely for the internal use for 'git pull'
271 to communicate with 'git fetch', and unless you are
272 implementing your own Porcelain you are not supposed to
276 --upload-pack <upload-pack>::
277 When given, and the repository to fetch from is handled
278 by 'git fetch-pack', `--exec=<upload-pack>` is passed to
279 the command to specify non-default path for the command
280 run on the other end.
285 Pass --quiet to git-fetch-pack and silence any other internally
286 used git commands. Progress is not reported to the standard error
295 Progress status is reported on the standard error stream
296 by default when it is attached to a terminal, unless -q
297 is specified. This flag forces progress status even if the
298 standard error stream is not directed to a terminal.
301 --server-option=<option>::
302 Transmit the given string to the server when communicating using
303 protocol version 2. The given string must not contain a NUL or LF
304 character. The server's handling of server options, including
305 unknown ones, is server-specific.
306 When multiple `--server-option=<option>` are given, they are all
307 sent to the other side in the order listed on the command line.
308 When no `--server-option=<option>` is given from the command line,
309 the values of configuration variable `remote.<name>.serverOption`
312 --show-forced-updates::
313 By default, git checks if a branch is force-updated during
314 fetch. This can be disabled through fetch.showForcedUpdates, but
315 the --show-forced-updates option guarantees this check occurs.
316 See linkgit:git-config[1].
318 --no-show-forced-updates::
319 By default, git checks if a branch is force-updated during
320 fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates
321 to false to skip this check for performance reasons. If used during
322 'git-pull' the --ff-only option will still check for forced updates
323 before attempting a fast-forward update. See linkgit:git-config[1].
327 Use IPv4 addresses only, ignoring IPv6 addresses.
331 Use IPv6 addresses only, ignoring IPv4 addresses.