]> git.ipfire.org Git - thirdparty/git.git/blob - Documentation/fetch-options.txt
Merge branch 'en/merge-recursive-directory-rename-fixes'
[thirdparty/git.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 --depth=<depth>::
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.
16
17 --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
22 --shallow-since=<date>::
23 Deepen or shorten the history of a shallow repository to
24 include all reachable commits after <date>.
25
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.
30
31 --unshallow::
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.
35 +
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.
38
39 --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.
44
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.
53 +
54 This option may be specified more than once; if so, Git will report
55 commits reachable from any of the given commits.
56 +
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.
60 +
61 See also the `fetch.negotiationAlgorithm` configuration variable
62 documented in linkgit:git-config[1].
63
64 ifndef::git-pull[]
65 --dry-run::
66 Show what would be done, without making any changes.
67 endif::git-pull[]
68
69 -f::
70 --force::
71 When 'git fetch' is used with `<src>:<dst>` refspec it may
72 refuse to update the local branch as discussed
73 ifdef::git-pull[]
74 in the `<refspec>` part of the linkgit:git-fetch[1]
75 documentation.
76 endif::git-pull[]
77 ifndef::git-pull[]
78 in the `<refspec>` part below.
79 endif::git-pull[]
80 This option overrides that check.
81
82 -k::
83 --keep::
84 Keep downloaded pack.
85
86 ifndef::git-pull[]
87 --multiple::
88 Allow several <repository> and <group> arguments to be
89 specified. No <refspec>s may be specified.
90
91 --[no-]auto-gc::
92 Run `git gc --auto` at the end to perform garbage collection
93 if needed. This is enabled by default.
94
95 -p::
96 --prune::
97 Before fetching, remove any remote-tracking references that no
98 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
104 subject to pruning. Supplying `--prune-tags` is a shorthand for
105 providing the tag refspec.
106 +
107 See 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.
117 +
118 See the PRUNING section below for more details.
119
120 endif::git-pull[]
121
122 ifndef::git-pull[]
123 -n::
124 endif::git-pull[]
125 --no-tags::
126 By default, tags that point at objects that are downloaded
127 from the remote repository are fetched and stored locally.
128 This option disables this automatic tag following. The default
129 behavior for a remote may be specified with the remote.<name>.tagOpt
130 setting. See linkgit:git-config[1].
131
132 ifndef::git-pull[]
133 --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
141 -t::
142 --tags::
143 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
148 destination of an explicit refspec; see `--prune`).
149
150 --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
158 reference to a commit that isn't already in the local submodule
159 clone.
160
161 -j::
162 --jobs=<n>::
163 Number of parallel children to be used for all forms of fetching.
164 +
165 If the `--multiple` option was specified, the different remotes will be fetched
166 in parallel. If multiple submodules are fetched, they will be fetched in
167 parallel. To control them independently, use the config settings
168 `fetch.parallel` and `submodule.fetchJobs` (see linkgit:git-config[1]).
169 +
170 Typically, parallel recursive and multi-remote fetches will be faster. By
171 default fetches are performed sequentially, not in parallel.
172
173 --no-recurse-submodules::
174 Disable recursive fetching of submodules (this has the same effect as
175 using the `--recurse-submodules=no` option).
176
177 --set-upstream::
178 If the remote is fetched successfully, pull and add upstream
179 (tracking) reference, used by argument-less
180 linkgit:git-pull[1] and other commands. For more information,
181 see `branch.<name>.merge` and `branch.<name>.remote` in
182 linkgit:git-config[1].
183
184 --submodule-prefix=<path>::
185 Prepend <path> to paths printed in informative messages
186 such as "Fetching submodule foo". This option is used
187 internally when recursing over submodules.
188
189 --recurse-submodules-default=[yes|on-demand]::
190 This option is used internally to temporarily provide a
191 non-negative default value for the --recurse-submodules
192 option. All other methods of configuring fetch's submodule
193 recursion (such as settings in linkgit:gitmodules[5] and
194 linkgit:git-config[1]) override this option, as does
195 specifying --[no-]recurse-submodules directly.
196 endif::git-pull[]
197
198 -u::
199 --update-head-ok::
200 By default 'git fetch' refuses to update the head which
201 corresponds to the current branch. This flag disables the
202 check. This is purely for the internal use for 'git pull'
203 to communicate with 'git fetch', and unless you are
204 implementing your own Porcelain you are not supposed to
205 use it.
206
207 --upload-pack <upload-pack>::
208 When given, and the repository to fetch from is handled
209 by 'git fetch-pack', `--exec=<upload-pack>` is passed to
210 the command to specify non-default path for the command
211 run on the other end.
212
213 ifndef::git-pull[]
214 -q::
215 --quiet::
216 Pass --quiet to git-fetch-pack and silence any other internally
217 used git commands. Progress is not reported to the standard error
218 stream.
219
220 -v::
221 --verbose::
222 Be verbose.
223 endif::git-pull[]
224
225 --progress::
226 Progress status is reported on the standard error stream
227 by default when it is attached to a terminal, unless -q
228 is specified. This flag forces progress status even if the
229 standard error stream is not directed to a terminal.
230
231 -o <option>::
232 --server-option=<option>::
233 Transmit the given string to the server when communicating using
234 protocol version 2. The given string must not contain a NUL or LF
235 character. The server's handling of server options, including
236 unknown ones, is server-specific.
237 When multiple `--server-option=<option>` are given, they are all
238 sent to the other side in the order listed on the command line.
239
240 --show-forced-updates::
241 By default, git checks if a branch is force-updated during
242 fetch. This can be disabled through fetch.showForcedUpdates, but
243 the --show-forced-updates option guarantees this check occurs.
244 See linkgit:git-config[1].
245
246 --no-show-forced-updates::
247 By default, git checks if a branch is force-updated during
248 fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates
249 to false to skip this check for performance reasons. If used during
250 'git-pull' the --ff-only option will still check for forced updates
251 before attempting a fast-forward update. See linkgit:git-config[1].
252
253 -4::
254 --ipv4::
255 Use IPv4 addresses only, ignoring IPv6 addresses.
256
257 -6::
258 --ipv6::
259 Use IPv6 addresses only, ignoring IPv4 addresses.