]>
Commit | Line | Data |
---|---|---|
9c4a036b BG |
1 | --all:: |
2 | Fetch all remotes. | |
3 | ||
3240240f SB |
4 | -a:: |
5 | --append:: | |
93d69d86 JL |
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 | ||
c7b190da PS |
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 | ||
6b276e19 | 14 | --depth=<depth>:: |
60253a60 SS |
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. | |
2c620a1a | 20 | |
cccf74e2 NTND |
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 | ||
508ea882 NTND |
26 | --shallow-since=<date>:: |
27 | Deepen or shorten the history of a shallow repository to | |
28 | include all reachable commits after <date>. | |
29 | ||
a45a2600 NTND |
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 | ||
4dcb167f | 35 | --unshallow:: |
79d3a236 NTND |
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. | |
4dcb167f | 42 | |
48d25cae NTND |
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. | |
4dcb167f | 48 | |
3390e42a JT |
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. | |
52660828 | 64 | + |
60fadf8b ÆAB |
65 | See also the `fetch.negotiationAlgorithm` and `push.negotiate` |
66 | configuration variables documented in linkgit:git-config[1], and the | |
67 | `--negotiate-only` option below. | |
68 | ||
69 | --negotiate-only:: | |
70 | Do not fetch anything from the server, and instead print the | |
71 | ancestors of the provided `--negotiation-tip=*` arguments, | |
72 | which we have in common with the server. | |
73 | + | |
74 | Internally this is used to implement the `push.negotiate` option, see | |
75 | linkgit:git-config[1]. | |
3390e42a | 76 | |
28a15401 JS |
77 | --dry-run:: |
78 | Show what would be done, without making any changes. | |
28a15401 | 79 | |
887952b8 JH |
80 | ifndef::git-pull[] |
81 | --[no-]write-fetch-head:: | |
82 | Write the list of remote refs fetched in the `FETCH_HEAD` | |
83 | file directly under `$GIT_DIR`. This is the default. | |
84 | Passing `--no-write-fetch-head` from the command line tells | |
85 | Git not to write the file. Under `--dry-run` option, the | |
86 | file is never written. | |
87 | endif::git-pull[] | |
88 | ||
3240240f SB |
89 | -f:: |
90 | --force:: | |
ae6a4703 ÆAB |
91 | When 'git fetch' is used with `<src>:<dst>` refspec it may |
92 | refuse to update the local branch as discussed | |
93 | ifdef::git-pull[] | |
94 | in the `<refspec>` part of the linkgit:git-fetch[1] | |
95 | documentation. | |
96 | endif::git-pull[] | |
97 | ifndef::git-pull[] | |
98 | in the `<refspec>` part below. | |
99 | endif::git-pull[] | |
100 | This option overrides that check. | |
93d69d86 | 101 | |
6b276e19 JA |
102 | -k:: |
103 | --keep:: | |
104 | Keep downloaded pack. | |
105 | ||
16679e37 BG |
106 | ifndef::git-pull[] |
107 | --multiple:: | |
108 | Allow several <repository> and <group> arguments to be | |
109 | specified. No <refspec>s may be specified. | |
f360d844 | 110 | |
a95ce124 | 111 | --[no-]auto-maintenance:: |
c3d6b703 | 112 | --[no-]auto-gc:: |
a95ce124 DS |
113 | Run `git maintenance run --auto` at the end to perform automatic |
114 | repository maintenance if needed. (`--[no-]auto-gc` is a synonym.) | |
115 | This is enabled by default. | |
c3d6b703 | 116 | |
c14e6e79 JS |
117 | --[no-]write-commit-graph:: |
118 | Write a commit-graph after fetching. This overrides the config | |
119 | setting `fetch.writeCommitGraph`. | |
9c688735 | 120 | endif::git-pull[] |
c14e6e79 | 121 | |
2e03115d DS |
122 | --prefetch:: |
123 | Modify the configured refspec to place all refs into the | |
124 | `refs/prefetch/` namespace. See the `prefetch` task in | |
125 | linkgit:git-maintenance[1]. | |
126 | ||
1b79d1c2 | 127 | -p:: |
f360d844 | 128 | --prune:: |
9e70233a | 129 | Before fetching, remove any remote-tracking references that no |
0838bf47 MH |
130 | longer exist on the remote. Tags are not subject to pruning |
131 | if they are fetched only because of the default tag | |
132 | auto-following or due to a --tags option. However, if tags | |
133 | are fetched due to an explicit refspec (either on the command | |
134 | line or in the remote configuration, for example if the remote | |
135 | was cloned with the --mirror option), then they are also | |
97716d21 ÆAB |
136 | subject to pruning. Supplying `--prune-tags` is a shorthand for |
137 | providing the tag refspec. | |
9c688735 | 138 | ifndef::git-pull[] |
97716d21 ÆAB |
139 | + |
140 | See the PRUNING section below for more details. | |
141 | ||
142 | -P:: | |
143 | --prune-tags:: | |
144 | Before fetching, remove any local tags that no longer exist on | |
145 | the remote if `--prune` is enabled. This option should be used | |
146 | more carefully, unlike `--prune` it will remove any local | |
147 | references (local tags) that have been created. This option is | |
148 | a shorthand for providing the explicit tag refspec along with | |
149 | `--prune`, see the discussion about that in its documentation. | |
627a129b ÆAB |
150 | + |
151 | See the PRUNING section below for more details. | |
152 | ||
16679e37 BG |
153 | endif::git-pull[] |
154 | ||
10eb64f5 | 155 | ifndef::git-pull[] |
3240240f | 156 | -n:: |
10eb64f5 | 157 | endif::git-pull[] |
01ca90c2 | 158 | --no-tags:: |
10eb64f5 MV |
159 | By default, tags that point at objects that are downloaded |
160 | from the remote repository are fetched and stored locally. | |
ed368546 | 161 | This option disables this automatic tag following. The default |
da0005b8 | 162 | behavior for a remote may be specified with the remote.<name>.tagOpt |
ed368546 | 163 | setting. See linkgit:git-config[1]. |
03febf99 | 164 | |
c5558f80 JH |
165 | --refmap=<refspec>:: |
166 | When fetching refs listed on the command line, use the | |
167 | specified refspec (can be given more than once) to map the | |
168 | refs to remote-tracking branches, instead of the values of | |
169 | `remote.*.fetch` configuration variables for the remote | |
b40a5026 DS |
170 | repository. Providing an empty `<refspec>` to the |
171 | `--refmap` option causes Git to ignore the configured | |
172 | refspecs and rely entirely on the refspecs supplied as | |
173 | command-line arguments. See section on "Configured Remote-tracking | |
c5558f80 JH |
174 | Branches" for details. |
175 | ||
3240240f SB |
176 | -t:: |
177 | --tags:: | |
0838bf47 MH |
178 | Fetch all tags from the remote (i.e., fetch remote tags |
179 | `refs/tags/*` into local tags with the same name), in addition | |
180 | to whatever else would otherwise be fetched. Using this | |
181 | option alone does not subject tags to pruning, even if --prune | |
182 | is used (though tags may be pruned anyway if they are also the | |
bcf9626a | 183 | destination of an explicit refspec; see `--prune`). |
93d69d86 | 184 | |
9c688735 | 185 | ifndef::git-pull[] |
8f0700dd JL |
186 | --recurse-submodules[=yes|on-demand|no]:: |
187 | This option controls if and under what conditions new commits of | |
188 | populated submodules should be fetched too. It can be used as a | |
189 | boolean option to completely disable recursion when set to 'no' or to | |
190 | unconditionally recurse into all populated submodules when set to | |
191 | 'yes', which is the default when this option is used without any | |
192 | value. Use 'on-demand' to only recurse into a populated submodule | |
193 | when the superproject retrieves a commit that updates the submodule's | |
c16c3e40 | 194 | reference to a commit that isn't already in the local submodule |
4da9e99e DR |
195 | clone. By default, 'on-demand' is used, unless |
196 | `fetch.recurseSubmodules` is set (see linkgit:git-config[1]). | |
9c688735 | 197 | endif::git-pull[] |
8f0700dd | 198 | |
62104ba1 SB |
199 | -j:: |
200 | --jobs=<n>:: | |
d54dea77 JS |
201 | Number of parallel children to be used for all forms of fetching. |
202 | + | |
203 | If the `--multiple` option was specified, the different remotes will be fetched | |
204 | in parallel. If multiple submodules are fetched, they will be fetched in | |
205 | parallel. To control them independently, use the config settings | |
206 | `fetch.parallel` and `submodule.fetchJobs` (see linkgit:git-config[1]). | |
207 | + | |
208 | Typically, parallel recursive and multi-remote fetches will be faster. By | |
209 | default fetches are performed sequentially, not in parallel. | |
62104ba1 | 210 | |
9c688735 | 211 | ifndef::git-pull[] |
8f0700dd JL |
212 | --no-recurse-submodules:: |
213 | Disable recursive fetching of submodules (this has the same effect as | |
bcf9626a | 214 | using the `--recurse-submodules=no` option). |
9c688735 | 215 | endif::git-pull[] |
7dce19d3 | 216 | |
24bc1a12 | 217 | --set-upstream:: |
847b3727 | 218 | If the remote is fetched successfully, add upstream |
24bc1a12 CB |
219 | (tracking) reference, used by argument-less |
220 | linkgit:git-pull[1] and other commands. For more information, | |
221 | see `branch.<name>.merge` and `branch.<name>.remote` in | |
222 | linkgit:git-config[1]. | |
223 | ||
9c688735 | 224 | ifndef::git-pull[] |
7dce19d3 JL |
225 | --submodule-prefix=<path>:: |
226 | Prepend <path> to paths printed in informative messages | |
227 | such as "Fetching submodule foo". This option is used | |
228 | internally when recursing over submodules. | |
88a21979 JL |
229 | |
230 | --recurse-submodules-default=[yes|on-demand]:: | |
231 | This option is used internally to temporarily provide a | |
232 | non-negative default value for the --recurse-submodules | |
233 | option. All other methods of configuring fetch's submodule | |
234 | recursion (such as settings in linkgit:gitmodules[5] and | |
235 | linkgit:git-config[1]) override this option, as does | |
236 | specifying --[no-]recurse-submodules directly. | |
93d69d86 | 237 | |
3240240f SB |
238 | -u:: |
239 | --update-head-ok:: | |
0b444cdb | 240 | By default 'git fetch' refuses to update the head which |
93d69d86 | 241 | corresponds to the current branch. This flag disables the |
0b444cdb TR |
242 | check. This is purely for the internal use for 'git pull' |
243 | to communicate with 'git fetch', and unless you are | |
a597fb0e JH |
244 | implementing your own Porcelain you are not supposed to |
245 | use it. | |
f05558f3 | 246 | endif::git-pull[] |
03febf99 | 247 | |
6b276e19 JA |
248 | --upload-pack <upload-pack>:: |
249 | When given, and the repository to fetch from is handled | |
bcf9626a | 250 | by 'git fetch-pack', `--exec=<upload-pack>` is passed to |
6b276e19 JA |
251 | the command to specify non-default path for the command |
252 | run on the other end. | |
253 | ||
254 | ifndef::git-pull[] | |
255 | -q:: | |
256 | --quiet:: | |
257 | Pass --quiet to git-fetch-pack and silence any other internally | |
9839018e TRC |
258 | used git commands. Progress is not reported to the standard error |
259 | stream. | |
6b276e19 JA |
260 | |
261 | -v:: | |
262 | --verbose:: | |
263 | Be verbose. | |
264 | endif::git-pull[] | |
9839018e TRC |
265 | |
266 | --progress:: | |
267 | Progress status is reported on the standard error stream | |
268 | by default when it is attached to a terminal, unless -q | |
269 | is specified. This flag forces progress status even if the | |
270 | standard error stream is not directed to a terminal. | |
c915f11e | 271 | |
5e3548ef BW |
272 | -o <option>:: |
273 | --server-option=<option>:: | |
274 | Transmit the given string to the server when communicating using | |
275 | protocol version 2. The given string must not contain a NUL or LF | |
6e983059 JT |
276 | character. The server's handling of server options, including |
277 | unknown ones, is server-specific. | |
5e3548ef BW |
278 | When multiple `--server-option=<option>` are given, they are all |
279 | sent to the other side in the order listed on the command line. | |
280 | ||
cdbd70c4 DS |
281 | --show-forced-updates:: |
282 | By default, git checks if a branch is force-updated during | |
283 | fetch. This can be disabled through fetch.showForcedUpdates, but | |
284 | the --show-forced-updates option guarantees this check occurs. | |
285 | See linkgit:git-config[1]. | |
286 | ||
287 | --no-show-forced-updates:: | |
288 | By default, git checks if a branch is force-updated during | |
289 | fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates | |
290 | to false to skip this check for performance reasons. If used during | |
291 | 'git-pull' the --ff-only option will still check for forced updates | |
292 | before attempting a fast-forward update. See linkgit:git-config[1]. | |
293 | ||
c915f11e EW |
294 | -4:: |
295 | --ipv4:: | |
296 | Use IPv4 addresses only, ignoring IPv6 addresses. | |
297 | ||
298 | -6:: | |
299 | --ipv6:: | |
300 | Use IPv6 addresses only, ignoring IPv4 addresses. |