Junio C Hamano | 9df0c66 | 2009-11-23 11:09:27 | [diff] [blame] | 1 | --all:: |
| 2 | Fetch all remotes. |
| 3 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 4 | -a:: |
| 5 | --append:: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 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 | |
Junio C Hamano | 7887f9b | 2021-01-25 23:32:33 | [diff] [blame] | 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 | |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 14 | --depth=<depth>:: |
Junio C Hamano | 4e6ba27 | 2016-01-20 23:23:19 | [diff] [blame] | 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. |
Junio C Hamano | e663a7a | 2006-01-25 12:37:28 | [diff] [blame] | 20 | |
Junio C Hamano | 20829a4 | 2016-10-10 23:24:44 | [diff] [blame] | 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 | |
Junio C Hamano | 0d1122e | 2013-02-01 21:37:02 | [diff] [blame] | 35 | --unshallow:: |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 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. |
Junio C Hamano | 0d1122e | 2013-02-01 21:37:02 | [diff] [blame] | 48 | |
Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 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. |
Junio C Hamano | bfd91f4 | 2018-08-17 22:21:16 | [diff] [blame] | 64 | + |
| 65 | See also the `fetch.negotiationAlgorithm` configuration variable |
| 66 | documented in linkgit:git-config[1]. |
Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 67 | |
Junio C Hamano | 9df0c66 | 2009-11-23 11:09:27 | [diff] [blame] | 68 | --dry-run:: |
| 69 | Show what would be done, without making any changes. |
Junio C Hamano | 9df0c66 | 2009-11-23 11:09:27 | [diff] [blame] | 70 | |
Junio C Hamano | 48d7a8a | 2020-08-24 22:56:56 | [diff] [blame] | 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 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 80 | -f:: |
| 81 | --force:: |
Junio C Hamano | 980e61e | 2018-09-17 22:45:52 | [diff] [blame] | 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. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 92 | |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 93 | -k:: |
| 94 | --keep:: |
| 95 | Keep downloaded pack. |
| 96 | |
Junio C Hamano | 9df0c66 | 2009-11-23 11:09:27 | [diff] [blame] | 97 | ifndef::git-pull[] |
| 98 | --multiple:: |
| 99 | Allow several <repository> and <group> arguments to be |
| 100 | specified. No <refspec>s may be specified. |
| 101 | |
Junio C Hamano | c562f6d | 2020-09-25 22:50:12 | [diff] [blame] | 102 | --[no-]auto-maintenance:: |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 103 | --[no-]auto-gc:: |
Junio C Hamano | c562f6d | 2020-09-25 22:50:12 | [diff] [blame] | 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. |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 107 | |
Junio C Hamano | 8ef91f3 | 2019-12-01 22:58:27 | [diff] [blame] | 108 | --[no-]write-commit-graph:: |
| 109 | Write a commit-graph after fetching. This overrides the config |
| 110 | setting `fetch.writeCommitGraph`. |
Junio C Hamano | 357906b | 2020-03-25 21:32:01 | [diff] [blame] | 111 | endif::git-pull[] |
Junio C Hamano | 8ef91f3 | 2019-12-01 22:58:27 | [diff] [blame] | 112 | |
Junio C Hamano | 70664a0 | 2010-07-13 22:48:05 | [diff] [blame] | 113 | -p:: |
Junio C Hamano | 9df0c66 | 2009-11-23 11:09:27 | [diff] [blame] | 114 | --prune:: |
Junio C Hamano | 042f214 | 2016-06-27 18:05:05 | [diff] [blame] | 115 | Before fetching, remove any remote-tracking references that no |
Junio C Hamano | 4c8f2d9 | 2013-12-13 00:55:42 | [diff] [blame] | 116 | longer exist on the remote. Tags are not subject to pruning |
| 117 | if they are fetched only because of the default tag |
| 118 | auto-following or due to a --tags option. However, if tags |
| 119 | are fetched due to an explicit refspec (either on the command |
| 120 | line or in the remote configuration, for example if the remote |
| 121 | was cloned with the --mirror option), then they are also |
Junio C Hamano | 664750f | 2018-03-06 23:25:44 | [diff] [blame] | 122 | subject to pruning. Supplying `--prune-tags` is a shorthand for |
| 123 | providing the tag refspec. |
Junio C Hamano | 357906b | 2020-03-25 21:32:01 | [diff] [blame] | 124 | ifndef::git-pull[] |
Junio C Hamano | 664750f | 2018-03-06 23:25:44 | [diff] [blame] | 125 | + |
| 126 | See the PRUNING section below for more details. |
| 127 | |
| 128 | -P:: |
| 129 | --prune-tags:: |
| 130 | Before fetching, remove any local tags that no longer exist on |
| 131 | the remote if `--prune` is enabled. This option should be used |
| 132 | more carefully, unlike `--prune` it will remove any local |
| 133 | references (local tags) that have been created. This option is |
| 134 | a shorthand for providing the explicit tag refspec along with |
| 135 | `--prune`, see the discussion about that in its documentation. |
| 136 | + |
| 137 | See the PRUNING section below for more details. |
| 138 | |
Junio C Hamano | 9df0c66 | 2009-11-23 11:09:27 | [diff] [blame] | 139 | endif::git-pull[] |
| 140 | |
Junio C Hamano | f7bb669 | 2008-01-27 08:23:46 | [diff] [blame] | 141 | ifndef::git-pull[] |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 142 | -n:: |
Junio C Hamano | f7bb669 | 2008-01-27 08:23:46 | [diff] [blame] | 143 | endif::git-pull[] |
Junio C Hamano | 4c8f2d9 | 2013-12-13 00:55:42 | [diff] [blame] | 144 | --no-tags:: |
Junio C Hamano | f7bb669 | 2008-01-27 08:23:46 | [diff] [blame] | 145 | By default, tags that point at objects that are downloaded |
| 146 | from the remote repository are fetched and stored locally. |
Junio C Hamano | 075ae87 | 2010-09-01 18:43:07 | [diff] [blame] | 147 | This option disables this automatic tag following. The default |
Junio C Hamano | 322c624 | 2015-03-23 21:32:46 | [diff] [blame] | 148 | behavior for a remote may be specified with the remote.<name>.tagOpt |
Junio C Hamano | 075ae87 | 2010-09-01 18:43:07 | [diff] [blame] | 149 | setting. See linkgit:git-config[1]. |
Junio C Hamano | 4d04a40 | 2006-01-09 00:53:28 | [diff] [blame] | 150 | |
Junio C Hamano | 45f804f | 2014-06-20 22:24:49 | [diff] [blame] | 151 | --refmap=<refspec>:: |
| 152 | When fetching refs listed on the command line, use the |
| 153 | specified refspec (can be given more than once) to map the |
| 154 | refs to remote-tracking branches, instead of the values of |
| 155 | `remote.*.fetch` configuration variables for the remote |
Junio C Hamano | bee061d | 2020-01-30 23:21:18 | [diff] [blame] | 156 | repository. Providing an empty `<refspec>` to the |
| 157 | `--refmap` option causes Git to ignore the configured |
| 158 | refspecs and rely entirely on the refspecs supplied as |
| 159 | command-line arguments. See section on "Configured Remote-tracking |
Junio C Hamano | 45f804f | 2014-06-20 22:24:49 | [diff] [blame] | 160 | Branches" for details. |
| 161 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 162 | -t:: |
| 163 | --tags:: |
Junio C Hamano | 4c8f2d9 | 2013-12-13 00:55:42 | [diff] [blame] | 164 | Fetch all tags from the remote (i.e., fetch remote tags |
| 165 | `refs/tags/*` into local tags with the same name), in addition |
| 166 | to whatever else would otherwise be fetched. Using this |
| 167 | option alone does not subject tags to pruning, even if --prune |
| 168 | is used (though tags may be pruned anyway if they are also the |
Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 169 | destination of an explicit refspec; see `--prune`). |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 170 | |
Junio C Hamano | 357906b | 2020-03-25 21:32:01 | [diff] [blame] | 171 | ifndef::git-pull[] |
Junio C Hamano | 5cd1518 | 2011-04-05 00:21:10 | [diff] [blame] | 172 | --recurse-submodules[=yes|on-demand|no]:: |
| 173 | This option controls if and under what conditions new commits of |
| 174 | populated submodules should be fetched too. It can be used as a |
| 175 | boolean option to completely disable recursion when set to 'no' or to |
| 176 | unconditionally recurse into all populated submodules when set to |
| 177 | 'yes', which is the default when this option is used without any |
| 178 | value. Use 'on-demand' to only recurse into a populated submodule |
| 179 | when the superproject retrieves a commit that updates the submodule's |
| 180 | reference to a commit that isn't already in the local submodule |
Junio C Hamano | 0dd5094 | 2020-04-29 21:21:05 | [diff] [blame] | 181 | clone. By default, 'on-demand' is used, unless |
| 182 | `fetch.recurseSubmodules` is set (see linkgit:git-config[1]). |
Junio C Hamano | 357906b | 2020-03-25 21:32:01 | [diff] [blame] | 183 | endif::git-pull[] |
Junio C Hamano | 5cd1518 | 2011-04-05 00:21:10 | [diff] [blame] | 184 | |
Junio C Hamano | a7da1ba | 2016-01-13 00:19:45 | [diff] [blame] | 185 | -j:: |
| 186 | --jobs=<n>:: |
Junio C Hamano | fa2a48b | 2019-10-15 05:24:40 | [diff] [blame] | 187 | Number of parallel children to be used for all forms of fetching. |
| 188 | + |
| 189 | If the `--multiple` option was specified, the different remotes will be fetched |
| 190 | in parallel. If multiple submodules are fetched, they will be fetched in |
| 191 | parallel. To control them independently, use the config settings |
| 192 | `fetch.parallel` and `submodule.fetchJobs` (see linkgit:git-config[1]). |
| 193 | + |
| 194 | Typically, parallel recursive and multi-remote fetches will be faster. By |
| 195 | default fetches are performed sequentially, not in parallel. |
Junio C Hamano | a7da1ba | 2016-01-13 00:19:45 | [diff] [blame] | 196 | |
Junio C Hamano | 357906b | 2020-03-25 21:32:01 | [diff] [blame] | 197 | ifndef::git-pull[] |
Junio C Hamano | 5cd1518 | 2011-04-05 00:21:10 | [diff] [blame] | 198 | --no-recurse-submodules:: |
| 199 | Disable recursive fetching of submodules (this has the same effect as |
Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 200 | using the `--recurse-submodules=no` option). |
Junio C Hamano | 357906b | 2020-03-25 21:32:01 | [diff] [blame] | 201 | endif::git-pull[] |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 202 | |
Junio C Hamano | cb70539 | 2019-09-18 19:30:01 | [diff] [blame] | 203 | --set-upstream:: |
Junio C Hamano | 779537c | 2020-08-19 23:48:51 | [diff] [blame] | 204 | If the remote is fetched successfully, add upstream |
Junio C Hamano | cb70539 | 2019-09-18 19:30:01 | [diff] [blame] | 205 | (tracking) reference, used by argument-less |
| 206 | linkgit:git-pull[1] and other commands. For more information, |
| 207 | see `branch.<name>.merge` and `branch.<name>.remote` in |
| 208 | linkgit:git-config[1]. |
| 209 | |
Junio C Hamano | 357906b | 2020-03-25 21:32:01 | [diff] [blame] | 210 | ifndef::git-pull[] |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 211 | --submodule-prefix=<path>:: |
| 212 | Prepend <path> to paths printed in informative messages |
| 213 | such as "Fetching submodule foo". This option is used |
| 214 | internally when recursing over submodules. |
Junio C Hamano | 5cd1518 | 2011-04-05 00:21:10 | [diff] [blame] | 215 | |
| 216 | --recurse-submodules-default=[yes|on-demand]:: |
| 217 | This option is used internally to temporarily provide a |
| 218 | non-negative default value for the --recurse-submodules |
| 219 | option. All other methods of configuring fetch's submodule |
| 220 | recursion (such as settings in linkgit:gitmodules[5] and |
| 221 | linkgit:git-config[1]) override this option, as does |
| 222 | specifying --[no-]recurse-submodules directly. |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 223 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 224 | -u:: |
| 225 | --update-head-ok:: |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 226 | By default 'git fetch' refuses to update the head which |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 227 | corresponds to the current branch. This flag disables the |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 228 | check. This is purely for the internal use for 'git pull' |
| 229 | to communicate with 'git fetch', and unless you are |
Junio C Hamano | b288d9e | 2007-01-02 00:04:15 | [diff] [blame] | 230 | implementing your own Porcelain you are not supposed to |
| 231 | use it. |
Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 232 | endif::git-pull[] |
Junio C Hamano | b288d9e | 2007-01-02 00:04:15 | [diff] [blame] | 233 | |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 234 | --upload-pack <upload-pack>:: |
| 235 | When given, and the repository to fetch from is handled |
Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 236 | by 'git fetch-pack', `--exec=<upload-pack>` is passed to |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 237 | the command to specify non-default path for the command |
| 238 | run on the other end. |
| 239 | |
| 240 | ifndef::git-pull[] |
| 241 | -q:: |
| 242 | --quiet:: |
| 243 | Pass --quiet to git-fetch-pack and silence any other internally |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 244 | used git commands. Progress is not reported to the standard error |
| 245 | stream. |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 246 | |
| 247 | -v:: |
| 248 | --verbose:: |
| 249 | Be verbose. |
| 250 | endif::git-pull[] |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 251 | |
| 252 | --progress:: |
| 253 | Progress status is reported on the standard error stream |
| 254 | by default when it is attached to a terminal, unless -q |
| 255 | is specified. This flag forces progress status even if the |
| 256 | standard error stream is not directed to a terminal. |
Junio C Hamano | 3fcdd07 | 2016-02-24 23:41:08 | [diff] [blame] | 257 | |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 258 | -o <option>:: |
| 259 | --server-option=<option>:: |
| 260 | Transmit the given string to the server when communicating using |
| 261 | protocol version 2. The given string must not contain a NUL or LF |
Junio C Hamano | d1063b1 | 2019-05-08 17:18:07 | [diff] [blame] | 262 | character. The server's handling of server options, including |
| 263 | unknown ones, is server-specific. |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 264 | When multiple `--server-option=<option>` are given, they are all |
| 265 | sent to the other side in the order listed on the command line. |
| 266 | |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 267 | --show-forced-updates:: |
| 268 | By default, git checks if a branch is force-updated during |
| 269 | fetch. This can be disabled through fetch.showForcedUpdates, but |
| 270 | the --show-forced-updates option guarantees this check occurs. |
| 271 | See linkgit:git-config[1]. |
| 272 | |
| 273 | --no-show-forced-updates:: |
| 274 | By default, git checks if a branch is force-updated during |
| 275 | fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates |
| 276 | to false to skip this check for performance reasons. If used during |
| 277 | 'git-pull' the --ff-only option will still check for forced updates |
| 278 | before attempting a fast-forward update. See linkgit:git-config[1]. |
| 279 | |
Junio C Hamano | 3fcdd07 | 2016-02-24 23:41:08 | [diff] [blame] | 280 | -4:: |
| 281 | --ipv4:: |
| 282 | Use IPv4 addresses only, ignoring IPv6 addresses. |
| 283 | |
| 284 | -6:: |
| 285 | --ipv6:: |
| 286 | Use IPv6 addresses only, ignoring IPv4 addresses. |