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