6 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.
11 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.
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.
22 --shallow-since=<date>::
23 Deepen or shorten the history of a shallow repository to
24 include all reachable commits after <date>.
26 --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.
32 If the source repository is complete, convert a shallow
33 repository to a complete one, removing all the limitations
34 imposed by shallow repositories.
36 If the source repository is shallow, fetch as much as possible so that
37 the current repository has the same history as the source repository.
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
45 --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.
54 This option may be specified more than once; if so, Git will report
55 commits reachable from any of the given commits.
57 The argument to this option may be a glob on ref names, a ref, or the (possibly
58 abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying
59 this option multiple times, one for each matching ref name.
61 See also the `fetch.negotiationAlgorithm` configuration variable
62 documented in linkgit:git-config[1].
65 Show what would be done, without making any changes.
68 --[no-]write-fetch-head::
69 Write the list of remote refs fetched in the `FETCH_HEAD`
70 file directly under `$GIT_DIR`. This is the default.
71 Passing `--no-write-fetch-head` from the command line tells
72 Git not to write the file. Under `--dry-run` option, the
73 file is never written.
78 When 'git fetch' is used with `<src>:<dst>` refspec it may
79 refuse to update the local branch as discussed
81 in the `<refspec>` part of the linkgit:git-fetch[1]
85 in the `<refspec>` part below.
87 This option overrides that check.
95 Allow several <repository> and <group> arguments to be
96 specified. No <refspec>s may be specified.
98 --[no-]auto-maintenance::
100 Run `git maintenance run --auto` at the end to perform automatic
101 repository maintenance if needed. (`--[no-]auto-gc` is a synonym.)
102 This is enabled by default.
104 --[no-]write-commit-graph::
105 Write a commit-graph after fetching. This overrides the config
106 setting `fetch.writeCommitGraph`.
111 Before fetching, remove any remote-tracking references that no
112 longer exist on the remote. Tags are not subject to pruning
113 if they are fetched only because of the default tag
114 auto-following or due to a --tags option. However, if tags
115 are fetched due to an explicit refspec (either on the command
116 line or in the remote configuration, for example if the remote
117 was cloned with the --mirror option), then they are also
118 subject to pruning. Supplying `--prune-tags` is a shorthand for
119 providing the tag refspec.
122 See the PRUNING section below for more details.
126 Before fetching, remove any local tags that no longer exist on
127 the remote if `--prune` is enabled. This option should be used
128 more carefully, unlike `--prune` it will remove any local
129 references (local tags) that have been created. This option is
130 a shorthand for providing the explicit tag refspec along with
131 `--prune`, see the discussion about that in its documentation.
133 See the PRUNING section below for more details.
141 By default, tags that point at objects that are downloaded
142 from the remote repository are fetched and stored locally.
143 This option disables this automatic tag following. The default
144 behavior for a remote may be specified with the remote.<name>.tagOpt
145 setting. See linkgit:git-config[1].
148 When fetching refs listed on the command line, use the
149 specified refspec (can be given more than once) to map the
150 refs to remote-tracking branches, instead of the values of
151 `remote.*.fetch` configuration variables for the remote
152 repository. Providing an empty `<refspec>` to the
153 `--refmap` option causes Git to ignore the configured
154 refspecs and rely entirely on the refspecs supplied as
155 command-line arguments. See section on "Configured Remote-tracking
156 Branches" for details.
160 Fetch all tags from the remote (i.e., fetch remote tags
161 `refs/tags/*` into local tags with the same name), in addition
162 to whatever else would otherwise be fetched. Using this
163 option alone does not subject tags to pruning, even if --prune
164 is used (though tags may be pruned anyway if they are also the
165 destination of an explicit refspec; see `--prune`).
168 --recurse-submodules[=yes|on-demand|no]::
169 This option controls if and under what conditions new commits of
170 populated submodules should be fetched too. It can be used as a
171 boolean option to completely disable recursion when set to 'no' or to
172 unconditionally recurse into all populated submodules when set to
173 'yes', which is the default when this option is used without any
174 value. Use 'on-demand' to only recurse into a populated submodule
175 when the superproject retrieves a commit that updates the submodule's
176 reference to a commit that isn't already in the local submodule
177 clone. By default, 'on-demand' is used, unless
178 `fetch.recurseSubmodules` is set (see linkgit:git-config[1]).
183 Number of parallel children to be used for all forms of fetching.
185 If the `--multiple` option was specified, the different remotes will be fetched
186 in parallel. If multiple submodules are fetched, they will be fetched in
187 parallel. To control them independently, use the config settings
188 `fetch.parallel` and `submodule.fetchJobs` (see linkgit:git-config[1]).
190 Typically, parallel recursive and multi-remote fetches will be faster. By
191 default fetches are performed sequentially, not in parallel.
194 --no-recurse-submodules::
195 Disable recursive fetching of submodules (this has the same effect as
196 using the `--recurse-submodules=no` option).
200 If the remote is fetched successfully, add upstream
201 (tracking) reference, used by argument-less
202 linkgit:git-pull[1] and other commands. For more information,
203 see `branch.<name>.merge` and `branch.<name>.remote` in
204 linkgit:git-config[1].
207 --submodule-prefix=<path>::
208 Prepend <path> to paths printed in informative messages
209 such as "Fetching submodule foo". This option is used
210 internally when recursing over submodules.
212 --recurse-submodules-default=[yes|on-demand]::
213 This option is used internally to temporarily provide a
214 non-negative default value for the --recurse-submodules
215 option. All other methods of configuring fetch's submodule
216 recursion (such as settings in linkgit:gitmodules[5] and
217 linkgit:git-config[1]) override this option, as does
218 specifying --[no-]recurse-submodules directly.
222 By default 'git fetch' refuses to update the head which
223 corresponds to the current branch. This flag disables the
224 check. This is purely for the internal use for 'git pull'
225 to communicate with 'git fetch', and unless you are
226 implementing your own Porcelain you are not supposed to
230 --upload-pack <upload-pack>::
231 When given, and the repository to fetch from is handled
232 by 'git fetch-pack', `--exec=<upload-pack>` is passed to
233 the command to specify non-default path for the command
234 run on the other end.
239 Pass --quiet to git-fetch-pack and silence any other internally
240 used git commands. Progress is not reported to the standard error
249 Progress status is reported on the standard error stream
250 by default when it is attached to a terminal, unless -q
251 is specified. This flag forces progress status even if the
252 standard error stream is not directed to a terminal.
255 --server-option=<option>::
256 Transmit the given string to the server when communicating using
257 protocol version 2. The given string must not contain a NUL or LF
258 character. The server's handling of server options, including
259 unknown ones, is server-specific.
260 When multiple `--server-option=<option>` are given, they are all
261 sent to the other side in the order listed on the command line.
263 --show-forced-updates::
264 By default, git checks if a branch is force-updated during
265 fetch. This can be disabled through fetch.showForcedUpdates, but
266 the --show-forced-updates option guarantees this check occurs.
267 See linkgit:git-config[1].
269 --no-show-forced-updates::
270 By default, git checks if a branch is force-updated during
271 fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates
272 to false to skip this check for performance reasons. If used during
273 'git-pull' the --ff-only option will still check for forced updates
274 before attempting a fast-forward update. See linkgit:git-config[1].
278 Use IPv4 addresses only, ignoring IPv6 addresses.
282 Use IPv6 addresses only, ignoring IPv4 addresses.