Merge branch 'ad/cygwin-no-backslashes-in-paths'
[git] / Documentation / fetch-options.txt
1 --all::
2         Fetch all remotes.
3
4 -a::
5 --append::
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.
9
10 --atomic::
11         Use an atomic transaction to update local refs. Either all refs are
12         updated, or on error, no refs are updated.
13
14 --depth=<depth>::
15         Limit fetching to the specified number of commits from the tip of
16         each remote branch history. If fetching to a 'shallow' repository
17         created by `git clone` with `--depth=<depth>` option (see
18         linkgit:git-clone[1]), deepen or shorten the history to the specified
19         number of commits. Tags for the deepened commits are not fetched.
20
21 --deepen=<depth>::
22         Similar to --depth, except it specifies the number of commits
23         from the current shallow boundary instead of from the tip of
24         each remote branch history.
25
26 --shallow-since=<date>::
27         Deepen or shorten the history of a shallow repository to
28         include all reachable commits after <date>.
29
30 --shallow-exclude=<revision>::
31         Deepen or shorten the history of a shallow repository to
32         exclude commits reachable from a specified remote branch or tag.
33         This option can be specified multiple times.
34
35 --unshallow::
36         If the source repository is complete, convert a shallow
37         repository to a complete one, removing all the limitations
38         imposed by shallow repositories.
39 +
40 If the source repository is shallow, fetch as much as possible so that
41 the current repository has the same history as the source repository.
42
43 --update-shallow::
44         By default when fetching from a shallow repository,
45         `git fetch` refuses refs that require updating
46         .git/shallow. This option updates .git/shallow and accept such
47         refs.
48
49 --negotiation-tip=<commit|glob>::
50         By default, Git will report, to the server, commits reachable
51         from all local refs to find common commits in an attempt to
52         reduce the size of the to-be-received packfile. If specified,
53         Git will only report commits reachable from the given tips.
54         This is useful to speed up fetches when the user knows which
55         local ref is likely to have commits in common with the
56         upstream ref being fetched.
57 +
58 This option may be specified more than once; if so, Git will report
59 commits reachable from any of the given commits.
60 +
61 The argument to this option may be a glob on ref names, a ref, or the (possibly
62 abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying
63 this option multiple times, one for each matching ref name.
64 +
65 See also the `fetch.negotiationAlgorithm` configuration variable
66 documented in linkgit:git-config[1].
67
68 --dry-run::
69         Show what would be done, without making any changes.
70
71 ifndef::git-pull[]
72 --[no-]write-fetch-head::
73         Write the list of remote refs fetched in the `FETCH_HEAD`
74         file directly under `$GIT_DIR`.  This is the default.
75         Passing `--no-write-fetch-head` from the command line tells
76         Git not to write the file.  Under `--dry-run` option, the
77         file is never written.
78 endif::git-pull[]
79
80 -f::
81 --force::
82         When 'git fetch' is used with `<src>:<dst>` refspec it may
83         refuse to update the local branch as discussed
84 ifdef::git-pull[]
85         in the `<refspec>` part of the linkgit:git-fetch[1]
86         documentation.
87 endif::git-pull[]
88 ifndef::git-pull[]
89         in the `<refspec>` part below.
90 endif::git-pull[]
91         This option overrides that check.
92
93 -k::
94 --keep::
95         Keep downloaded pack.
96
97 ifndef::git-pull[]
98 --multiple::
99         Allow several <repository> and <group> arguments to be
100         specified. No <refspec>s may be specified.
101
102 --[no-]auto-maintenance::
103 --[no-]auto-gc::
104         Run `git maintenance run --auto` at the end to perform automatic
105         repository maintenance if needed. (`--[no-]auto-gc` is a synonym.)
106         This is enabled by default.
107
108 --[no-]write-commit-graph::
109         Write a commit-graph after fetching. This overrides the config
110         setting `fetch.writeCommitGraph`.
111 endif::git-pull[]
112
113 --prefetch::
114         Modify the configured refspec to place all refs into the
115         `refs/prefetch/` namespace. See the `prefetch` task in
116         linkgit:git-maintenance[1].
117
118 -p::
119 --prune::
120         Before fetching, remove any remote-tracking references that no
121         longer exist on the remote.  Tags are not subject to pruning
122         if they are fetched only because of the default tag
123         auto-following or due to a --tags option.  However, if tags
124         are fetched due to an explicit refspec (either on the command
125         line or in the remote configuration, for example if the remote
126         was cloned with the --mirror option), then they are also
127         subject to pruning. Supplying `--prune-tags` is a shorthand for
128         providing the tag refspec.
129 ifndef::git-pull[]
130 +
131 See the PRUNING section below for more details.
132
133 -P::
134 --prune-tags::
135         Before fetching, remove any local tags that no longer exist on
136         the remote if `--prune` is enabled. This option should be used
137         more carefully, unlike `--prune` it will remove any local
138         references (local tags) that have been created. This option is
139         a shorthand for providing the explicit tag refspec along with
140         `--prune`, see the discussion about that in its documentation.
141 +
142 See the PRUNING section below for more details.
143
144 endif::git-pull[]
145
146 ifndef::git-pull[]
147 -n::
148 endif::git-pull[]
149 --no-tags::
150         By default, tags that point at objects that are downloaded
151         from the remote repository are fetched and stored locally.
152         This option disables this automatic tag following. The default
153         behavior for a remote may be specified with the remote.<name>.tagOpt
154         setting. See linkgit:git-config[1].
155
156 --refmap=<refspec>::
157         When fetching refs listed on the command line, use the
158         specified refspec (can be given more than once) to map the
159         refs to remote-tracking branches, instead of the values of
160         `remote.*.fetch` configuration variables for the remote
161         repository.  Providing an empty `<refspec>` to the
162         `--refmap` option causes Git to ignore the configured
163         refspecs and rely entirely on the refspecs supplied as
164         command-line arguments. See section on "Configured Remote-tracking
165         Branches" for details.
166
167 -t::
168 --tags::
169         Fetch all tags from the remote (i.e., fetch remote tags
170         `refs/tags/*` into local tags with the same name), in addition
171         to whatever else would otherwise be fetched.  Using this
172         option alone does not subject tags to pruning, even if --prune
173         is used (though tags may be pruned anyway if they are also the
174         destination of an explicit refspec; see `--prune`).
175
176 ifndef::git-pull[]
177 --recurse-submodules[=yes|on-demand|no]::
178         This option controls if and under what conditions new commits of
179         populated submodules should be fetched too. It can be used as a
180         boolean option to completely disable recursion when set to 'no' or to
181         unconditionally recurse into all populated submodules when set to
182         'yes', which is the default when this option is used without any
183         value. Use 'on-demand' to only recurse into a populated submodule
184         when the superproject retrieves a commit that updates the submodule's
185         reference to a commit that isn't already in the local submodule
186         clone. By default, 'on-demand' is used, unless
187         `fetch.recurseSubmodules` is set (see linkgit:git-config[1]).
188 endif::git-pull[]
189
190 -j::
191 --jobs=<n>::
192         Number of parallel children to be used for all forms of fetching.
193 +
194 If the `--multiple` option was specified, the different remotes will be fetched
195 in parallel. If multiple submodules are fetched, they will be fetched in
196 parallel. To control them independently, use the config settings
197 `fetch.parallel` and `submodule.fetchJobs` (see linkgit:git-config[1]).
198 +
199 Typically, parallel recursive and multi-remote fetches will be faster. By
200 default fetches are performed sequentially, not in parallel.
201
202 ifndef::git-pull[]
203 --no-recurse-submodules::
204         Disable recursive fetching of submodules (this has the same effect as
205         using the `--recurse-submodules=no` option).
206 endif::git-pull[]
207
208 --set-upstream::
209         If the remote is fetched successfully, add upstream
210         (tracking) reference, used by argument-less
211         linkgit:git-pull[1] and other commands. For more information,
212         see `branch.<name>.merge` and `branch.<name>.remote` in
213         linkgit:git-config[1].
214
215 ifndef::git-pull[]
216 --submodule-prefix=<path>::
217         Prepend <path> to paths printed in informative messages
218         such as "Fetching submodule foo".  This option is used
219         internally when recursing over submodules.
220
221 --recurse-submodules-default=[yes|on-demand]::
222         This option is used internally to temporarily provide a
223         non-negative default value for the --recurse-submodules
224         option.  All other methods of configuring fetch's submodule
225         recursion (such as settings in linkgit:gitmodules[5] and
226         linkgit:git-config[1]) override this option, as does
227         specifying --[no-]recurse-submodules directly.
228
229 -u::
230 --update-head-ok::
231         By default 'git fetch' refuses to update the head which
232         corresponds to the current branch.  This flag disables the
233         check.  This is purely for the internal use for 'git pull'
234         to communicate with 'git fetch', and unless you are
235         implementing your own Porcelain you are not supposed to
236         use it.
237 endif::git-pull[]
238
239 --upload-pack <upload-pack>::
240         When given, and the repository to fetch from is handled
241         by 'git fetch-pack', `--exec=<upload-pack>` is passed to
242         the command to specify non-default path for the command
243         run on the other end.
244
245 ifndef::git-pull[]
246 -q::
247 --quiet::
248         Pass --quiet to git-fetch-pack and silence any other internally
249         used git commands. Progress is not reported to the standard error
250         stream.
251
252 -v::
253 --verbose::
254         Be verbose.
255 endif::git-pull[]
256
257 --progress::
258         Progress status is reported on the standard error stream
259         by default when it is attached to a terminal, unless -q
260         is specified. This flag forces progress status even if the
261         standard error stream is not directed to a terminal.
262
263 -o <option>::
264 --server-option=<option>::
265         Transmit the given string to the server when communicating using
266         protocol version 2.  The given string must not contain a NUL or LF
267         character.  The server's handling of server options, including
268         unknown ones, is server-specific.
269         When multiple `--server-option=<option>` are given, they are all
270         sent to the other side in the order listed on the command line.
271
272 --show-forced-updates::
273         By default, git checks if a branch is force-updated during
274         fetch. This can be disabled through fetch.showForcedUpdates, but
275         the --show-forced-updates option guarantees this check occurs.
276         See linkgit:git-config[1].
277
278 --no-show-forced-updates::
279         By default, git checks if a branch is force-updated during
280         fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates
281         to false to skip this check for performance reasons. If used during
282         'git-pull' the --ff-only option will still check for forced updates
283         before attempting a fast-forward update. See linkgit:git-config[1].
284
285 -4::
286 --ipv4::
287         Use IPv4 addresses only, ignoring IPv6 addresses.
288
289 -6::
290 --ipv6::
291         Use IPv6 addresses only, ignoring IPv4 addresses.