Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/Documentation/fetch-options.adoc # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / Documentation / fetch-options.adoc` 385 lines ยท 15046 bytes Raw Blame History 1 `--all`:: 2 `--no-all`:: 3 Fetch all remotes, except for the ones that have the 4 `remote..skipFetchAll` configuration variable set. 5 This overrides the configuration variable `fetch.all`. 6 7 `-a`:: 8 `--append`:: 9 Append ref names and object names of fetched refs to the 10 existing contents of `.git/FETCH_HEAD`. Without this 11 option old data in `.git/FETCH_HEAD` will be overwritten. 12 13 `--atomic`:: 14 Use an atomic transaction to update local refs. Either all refs are 15 updated, or on error, no refs are updated. 16 17 `--depth=`:: 18 Limit fetching to the specified number of commits from the tip of 19 each remote branch history. If fetching to a 'shallow' repository 20 created by `git clone` with `--depth=` option (see 21 linkgit:git-clone[1]), deepen or shorten the history to the specified 22 number of commits. Tags for the deepened commits are not fetched. 23 24 `--deepen=`:: 25 Similar to `--depth`, except it specifies the number of commits 26 from the current shallow boundary instead of from the tip of 27 each remote branch history. 28 29 `--shallow-since=`:: 30 Deepen or shorten the history of a shallow repository to 31 include all reachable commits after __. 32 33 `--shallow-exclude=`:: 34 Deepen or shorten the history of a shallow repository to 35 exclude commits reachable from a specified remote branch or tag. 36 This option can be specified multiple times. 37 38 `--unshallow`:: 39 If the source repository is complete, convert a shallow 40 repository to a complete one, removing all the limitations 41 imposed by shallow repositories. 42 + 43 If the source repository is shallow, fetch as much as possible so that 44 the current repository has the same history as the source repository. 45 46 `--update-shallow`:: 47 By default when fetching from a shallow repository, 48 `git fetch` refuses refs that require updating 49 `.git/shallow`. This option updates `.git/shallow` and accepts such 50 refs. 51 52 `--negotiation-restrict=(|)`:: 53 `--negotiation-tip=(|)`:: 54 By default, Git will report, to the server, commits reachable 55 from all local refs to find common commits in an attempt to 56 reduce the size of the to-be-received packfile. If specified, 57 Git will only report commits reachable from the given tips. 58 This is useful to speed up fetches when the user knows which 59 local ref is likely to have commits in common with the 60 upstream ref being fetched. 61 + 62 `--negotiation-restrict` is the preferred name for this option; 63 `--negotiation-tip` is accepted as a synonym. 64 + 65 This option may be specified more than once; if so, Git will report 66 commits reachable from any of the given commits. 67 + 68 The argument to this option may be a glob on ref names, a ref, or the (possibly 69 abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying 70 this option multiple times, one for each matching ref name. 71 + 72 See also the `fetch.negotiationAlgorithm` and `push.negotiate` 73 configuration variables documented in linkgit:git-config[1], and the 74 `--negotiate-only` option below. 75 76 `--negotiation-include=(|)`:: 77 Ensure that the commits at the given tips are always sent as "have" 78 lines during fetch negotiation, regardless of what the negotiation 79 algorithm selects. This is useful to guarantee that common 80 history reachable from specific refs is always considered, even 81 when `--negotiation-restrict` restricts the set of tips or when 82 the negotiation algorithm would otherwise skip them. 83 + 84 This option may be specified more than once; if so, each commit is sent 85 unconditionally. 86 + 87 The argument may be an exact ref name (e.g. `refs/heads/release`), an 88 object hash, or a glob pattern (e.g. `refs/heads/release/{asterisk}`). 89 The pattern syntax is the same as for `--negotiation-restrict`. 90 + 91 If `--negotiation-restrict` is used, the have set is first restricted by 92 that option and then increased to include the tips specified by 93 `--negotiation-include`. 94 + 95 If this option is not specified on the command line, then any 96 `remote..negotiationInclude` config values for the current remote 97 are used instead. 98 99 `--negotiate-only`:: 100 Do not fetch anything from the server, and instead print the 101 ancestors of the provided `--negotiation-restrict=` arguments, 102 which we have in common with the server. 103 + 104 This is incompatible with `--recurse-submodules=(yes|on-demand)`. 105 Internally this is used to implement the `push.negotiate` option, see 106 linkgit:git-config[1]. 107 108 `--dry-run`:: 109 Show what would be done, without making any changes. 110 111 `--porcelain`:: 112 Print the output to standard output in an easy-to-parse format for 113 scripts. See section OUTPUT in linkgit:git-fetch[1] for details. 114 + 115 This is incompatible with `--recurse-submodules=(yes|on-demand)` and takes 116 precedence over the `fetch.output` config option. 117 118 `--filter=`:: 119 Use the partial clone feature and request that the server sends 120 a subset of reachable objects according to a given object filter. 121 When using `--filter`, the supplied __ is used for 122 the partial fetch. 123 + 124 If `--filter=auto` is used, the filter specification is determined 125 automatically by combining the filter specifications advertised by 126 the server for the promisor remotes that the client accepts (see 127 linkgit:gitprotocol-v2[5] and the `promisor.acceptFromServer` 128 configuration option in linkgit:git-config[1]). 129 + 130 For details on all other available filter specifications, see the 131 `--filter=` option in linkgit:git-rev-list[1]. 132 + 133 For example, `--filter=blob:none` will filter out all blobs (file 134 contents) until needed by Git. Also, `--filter=blob:limit=` will 135 filter out all blobs of size at least __. 136 137 ifndef::git-pull[] 138 `--write-fetch-head`:: 139 `--no-write-fetch-head`:: 140 Write the list of remote refs fetched in the `FETCH_HEAD` 141 file directly under `$GIT_DIR`. This is the default. 142 Passing `--no-write-fetch-head` from the command line tells 143 Git not to write the file. Under `--dry-run` option, the 144 file is never written. 145 endif::git-pull[] 146 147 `-f`:: 148 `--force`:: 149 ifdef::git-pull[] 150 When `git fetch` is used with `:` refspec, it may 151 refuse to update the local branch as discussed 152 in the __ part of the linkgit:git-fetch[1] 153 documentation. 154 endif::git-pull[] 155 ifndef::git-pull[] 156 When `git fetch` is used with `:` refspec, it may 157 refuse to update the local branch as discussed in the __ part below. 158 endif::git-pull[] 159 This option overrides that check. 160 161 `-k`:: 162 `--keep`:: 163 Keep downloaded pack. 164 165 ifndef::git-pull[] 166 `--multiple`:: 167 Allow several __ and __ arguments to be 168 specified. No ____s may be specified. 169 170 `--auto-maintenance`:: 171 `--no-auto-maintenance`:: 172 `--auto-gc`:: 173 `--no-auto-gc`:: 174 Run `git maintenance run --auto` at the end to perform automatic 175 repository maintenance if needed. 176 This is enabled by default. 177 178 `--write-commit-graph`:: 179 `--no-write-commit-graph`:: 180 Write a commit-graph after fetching. This overrides the config 181 setting `fetch.writeCommitGraph`. 182 endif::git-pull[] 183 184 `--prefetch`:: 185 Modify the configured refspec to place all refs into the 186 `refs/prefetch/` namespace. See the `prefetch` task in 187 linkgit:git-maintenance[1]. 188 189 `-p`:: 190 `--prune`:: 191 Before fetching, remove any remote-tracking references that no 192 longer exist on the remote. Tags are not subject to pruning 193 if they are fetched only because of the default tag 194 auto-following or due to a `--tags` option. However, if tags 195 are fetched due to an explicit refspec (either on the command 196 line or in the remote configuration, for example if the remote 197 was cloned with the `--mirror` option), then they are also 198 subject to pruning. Supplying `--prune-tags` is a shorthand for 199 providing the tag refspec. 200 ifndef::git-pull[] 201 + 202 See the <> section below for more details. 203 204 `-P`:: 205 `--prune-tags`:: 206 Before fetching, remove any local tags that no longer exist on 207 the remote if `--prune` is enabled. This option should be used 208 more carefully, unlike `--prune` it will remove any local 209 references (local tags) that have been created. This option is 210 a shorthand for providing the explicit tag refspec along with 211 `--prune`, see the discussion about that in its documentation. 212 + 213 See the <> section below for more details. 214 215 endif::git-pull[] 216 217 ifndef::git-pull[] 218 `-n`:: 219 endif::git-pull[] 220 `--no-tags`:: 221 By default, tags that point at objects that are downloaded 222 from the remote repository are fetched and stored locally. 223 This option disables this automatic tag following. The default 224 behavior for a remote may be specified with the `remote..tagOpt` 225 setting. See linkgit:git-config[1]. 226 227 ifndef::git-pull[] 228 `--refetch`:: 229 Instead of negotiating with the server to avoid transferring commits and 230 associated objects that are already present locally, this option fetches 231 all objects as a fresh clone would. Use this to reapply a partial clone 232 filter from configuration or using `--filter=` when the filter 233 definition has changed. Automatic post-fetch maintenance will perform 234 object database pack consolidation to remove any duplicate objects. 235 endif::git-pull[] 236 237 `--refmap=`:: 238 When fetching refs listed on the command line, use the 239 specified refspec (can be given more than once) to map the 240 refs to remote-tracking branches, instead of the values of 241 `remote..fetch` configuration variables for the remote 242 repository. Providing an empty __ to the 243 `--refmap` option causes Git to ignore the configured 244 refspecs and rely entirely on the refspecs supplied as 245 command-line arguments. See section on "Configured Remote-tracking 246 Branches" for details. 247 248 `-t`:: 249 `--tags`:: 250 Fetch all tags from the remote (i.e., fetch remote tags 251 `refs/tags/*` into local tags with the same name), in addition 252 to whatever else would otherwise be fetched. Using this 253 option alone does not subject tags to pruning, even if `--prune` 254 is used (though tags may be pruned anyway if they are also the 255 destination of an explicit refspec; see `--prune`). 256 257 ifndef::git-pull[] 258 `--recurse-submodules[=(yes|on-demand|no)]`:: 259 Control if and under what conditions new commits of 260 submodules should be fetched too. When recursing through submodules, 261 `git fetch` always attempts to fetch "changed" submodules, that is, a 262 submodule that has commits that are referenced by a newly fetched 263 superproject commit but are missing in the local submodule clone. A 264 changed submodule can be fetched as long as it is present locally e.g. 265 in `$GIT_DIR/modules/` (see linkgit:gitsubmodules[7]); if the upstream 266 adds a new submodule, that submodule cannot be fetched until it is 267 cloned e.g. by `git submodule update`. 268 + 269 When set to `on-demand`, only changed submodules are fetched. When set 270 to `yes`, all populated submodules are fetched and submodules that are 271 both unpopulated and changed are fetched. When set to `no`, submodules 272 are never fetched. 273 + 274 When unspecified, this uses the value of `fetch.recurseSubmodules` if it 275 is set (see linkgit:git-config[1]), defaulting to `on-demand` if unset. 276 When this option is used without any value, it defaults to `yes`. 277 endif::git-pull[] 278 279 `-j `:: 280 `--jobs=`:: 281 Parallelize all forms of fetching up to __ jobs at a time. 282 + 283 A value of 0 will use some reasonable default. 284 + 285 If the `--multiple` option was specified, the different remotes will be fetched 286 in parallel. If multiple submodules are fetched, they will be fetched in 287 parallel. To control them independently, use the config settings 288 `fetch.parallel` and `submodule.fetchJobs` (see linkgit:git-config[1]). 289 + 290 Typically, parallel recursive and multi-remote fetches will be faster. By 291 default fetches are performed sequentially, not in parallel. 292 293 ifndef::git-pull[] 294 `--no-recurse-submodules`:: 295 Disable recursive fetching of submodules (this has the same effect as 296 using the `--recurse-submodules=no` option). 297 endif::git-pull[] 298 299 `--set-upstream`:: 300 If the remote is fetched successfully, add upstream 301 (tracking) reference, used by argument-less 302 linkgit:git-pull[1] and other commands. For more information, 303 see `branch..merge` and `branch..remote` in 304 linkgit:git-config[1]. 305 306 ifndef::git-pull[] 307 `--submodule-prefix=`:: 308 Prepend __ to paths printed in informative messages 309 such as "Fetching submodule foo". This option is used 310 internally when recursing over submodules. 311 312 `--recurse-submodules-default=(yes|on-demand)`:: 313 This option is used internally to temporarily provide a 314 non-negative default value for the `--recurse-submodules` 315 option. All other methods of configuring fetch's submodule 316 recursion (such as settings in linkgit:gitmodules[5] and 317 linkgit:git-config[1]) override this option, as does 318 specifying `--[no-]recurse-submodules` directly. 319 320 `-u`:: 321 `--update-head-ok`:: 322 By default `git fetch` refuses to update the head which 323 corresponds to the current branch. This flag disables the 324 check. This is purely for the internal use for `git pull` 325 to communicate with `git fetch`, and unless you are 326 implementing your own Porcelain you are not supposed to 327 use it. 328 endif::git-pull[] 329 330 `--upload-pack `:: 331 When given, and the repository to fetch from is handled 332 by `git fetch-pack`, `--exec=` is passed to 333 the command to specify non-default path for the command 334 run on the other end. 335 336 ifndef::git-pull[] 337 `-q`:: 338 `--quiet`:: 339 Pass `--quiet` to `git-fetch-pack` and silence any other internally 340 used git commands. Progress is not reported to the standard error 341 stream. 342 343 `-v`:: 344 `--verbose`:: 345 Be verbose. 346 endif::git-pull[] 347 348 `--progress`:: 349 Progress status is reported on the standard error stream 350 by default when it is attached to a terminal, unless `-q` 351 is specified. This flag forces progress status even if the 352 standard error stream is not directed to a terminal. 353 354 `-o