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 | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 10 | --depth=<depth>:: |
Junio C Hamano | 4e6ba27 | 2016-01-20 23:23:19 | [diff] [blame] | 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. |
Junio C Hamano | e663a7a | 2006-01-25 12:37:28 | [diff] [blame] | 16 | |
Junio C Hamano | 20829a4 | 2016-10-10 23:24:44 | [diff] [blame] | 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 | |
Junio C Hamano | 0d1122e | 2013-02-01 21:37:02 | [diff] [blame] | 31 | --unshallow:: |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 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. |
Junio C Hamano | 0d1122e | 2013-02-01 21:37:02 | [diff] [blame] | 44 | |
Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 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. |
Junio C Hamano | bfd91f4 | 2018-08-17 22:21:16 | [diff] [blame] | 60 | + |
| 61 | See also the `fetch.negotiationAlgorithm` configuration variable |
| 62 | documented in linkgit:git-config[1]. |
Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 63 | |
Junio C Hamano | 9df0c66 | 2009-11-23 11:09:27 | [diff] [blame] | 64 | ifndef::git-pull[] |
| 65 | --dry-run:: |
| 66 | Show what would be done, without making any changes. |
| 67 | endif::git-pull[] |
| 68 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 69 | -f:: |
| 70 | --force:: |
Junio C Hamano | 980e61e | 2018-09-17 22:45:52 | [diff] [blame] | 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. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 81 | |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 82 | -k:: |
| 83 | --keep:: |
| 84 | Keep downloaded pack. |
| 85 | |
Junio C Hamano | 9df0c66 | 2009-11-23 11:09:27 | [diff] [blame] | 86 | ifndef::git-pull[] |
| 87 | --multiple:: |
| 88 | Allow several <repository> and <group> arguments to be |
| 89 | specified. No <refspec>s may be specified. |
| 90 | |
Junio C Hamano | 70664a0 | 2010-07-13 22:48:05 | [diff] [blame] | 91 | -p:: |
Junio C Hamano | 9df0c66 | 2009-11-23 11:09:27 | [diff] [blame] | 92 | --prune:: |
Junio C Hamano | 042f214 | 2016-06-27 18:05:05 | [diff] [blame] | 93 | Before fetching, remove any remote-tracking references that no |
Junio C Hamano | 4c8f2d9 | 2013-12-13 00:55:42 | [diff] [blame] | 94 | longer exist on the remote. Tags are not subject to pruning |
| 95 | if they are fetched only because of the default tag |
| 96 | auto-following or due to a --tags option. However, if tags |
| 97 | are fetched due to an explicit refspec (either on the command |
| 98 | line or in the remote configuration, for example if the remote |
| 99 | was cloned with the --mirror option), then they are also |
Junio C Hamano | 664750f | 2018-03-06 23:25:44 | [diff] [blame] | 100 | subject to pruning. Supplying `--prune-tags` is a shorthand for |
| 101 | providing the tag refspec. |
| 102 | + |
| 103 | See the PRUNING section below for more details. |
| 104 | |
| 105 | -P:: |
| 106 | --prune-tags:: |
| 107 | Before fetching, remove any local tags that no longer exist on |
| 108 | the remote if `--prune` is enabled. This option should be used |
| 109 | more carefully, unlike `--prune` it will remove any local |
| 110 | references (local tags) that have been created. This option is |
| 111 | a shorthand for providing the explicit tag refspec along with |
| 112 | `--prune`, see the discussion about that in its documentation. |
| 113 | + |
| 114 | See the PRUNING section below for more details. |
| 115 | |
Junio C Hamano | 9df0c66 | 2009-11-23 11:09:27 | [diff] [blame] | 116 | endif::git-pull[] |
| 117 | |
Junio C Hamano | f7bb669 | 2008-01-27 08:23:46 | [diff] [blame] | 118 | ifndef::git-pull[] |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 119 | -n:: |
Junio C Hamano | f7bb669 | 2008-01-27 08:23:46 | [diff] [blame] | 120 | endif::git-pull[] |
Junio C Hamano | 4c8f2d9 | 2013-12-13 00:55:42 | [diff] [blame] | 121 | --no-tags:: |
Junio C Hamano | f7bb669 | 2008-01-27 08:23:46 | [diff] [blame] | 122 | By default, tags that point at objects that are downloaded |
| 123 | from the remote repository are fetched and stored locally. |
Junio C Hamano | 075ae87 | 2010-09-01 18:43:07 | [diff] [blame] | 124 | This option disables this automatic tag following. The default |
Junio C Hamano | 322c624 | 2015-03-23 21:32:46 | [diff] [blame] | 125 | behavior for a remote may be specified with the remote.<name>.tagOpt |
Junio C Hamano | 075ae87 | 2010-09-01 18:43:07 | [diff] [blame] | 126 | setting. See linkgit:git-config[1]. |
Junio C Hamano | 4d04a40 | 2006-01-09 00:53:28 | [diff] [blame] | 127 | |
Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 128 | ifndef::git-pull[] |
Junio C Hamano | 45f804f | 2014-06-20 22:24:49 | [diff] [blame] | 129 | --refmap=<refspec>:: |
| 130 | When fetching refs listed on the command line, use the |
| 131 | specified refspec (can be given more than once) to map the |
| 132 | refs to remote-tracking branches, instead of the values of |
| 133 | `remote.*.fetch` configuration variables for the remote |
| 134 | repository. See section on "Configured Remote-tracking |
| 135 | Branches" for details. |
| 136 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 137 | -t:: |
| 138 | --tags:: |
Junio C Hamano | 4c8f2d9 | 2013-12-13 00:55:42 | [diff] [blame] | 139 | Fetch all tags from the remote (i.e., fetch remote tags |
| 140 | `refs/tags/*` into local tags with the same name), in addition |
| 141 | to whatever else would otherwise be fetched. Using this |
| 142 | option alone does not subject tags to pruning, even if --prune |
| 143 | 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] | 144 | destination of an explicit refspec; see `--prune`). |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 145 | |
Junio C Hamano | 5cd1518 | 2011-04-05 00:21:10 | [diff] [blame] | 146 | --recurse-submodules[=yes|on-demand|no]:: |
| 147 | This option controls if and under what conditions new commits of |
| 148 | populated submodules should be fetched too. It can be used as a |
| 149 | boolean option to completely disable recursion when set to 'no' or to |
| 150 | unconditionally recurse into all populated submodules when set to |
| 151 | 'yes', which is the default when this option is used without any |
| 152 | value. Use 'on-demand' to only recurse into a populated submodule |
| 153 | when the superproject retrieves a commit that updates the submodule's |
| 154 | reference to a commit that isn't already in the local submodule |
| 155 | clone. |
| 156 | |
Junio C Hamano | a7da1ba | 2016-01-13 00:19:45 | [diff] [blame] | 157 | -j:: |
| 158 | --jobs=<n>:: |
| 159 | Number of parallel children to be used for fetching submodules. |
| 160 | Each will fetch from different submodules, such that fetching many |
| 161 | submodules will be faster. By default submodules will be fetched |
| 162 | one at a time. |
| 163 | |
Junio C Hamano | 5cd1518 | 2011-04-05 00:21:10 | [diff] [blame] | 164 | --no-recurse-submodules:: |
| 165 | Disable recursive fetching of submodules (this has the same effect as |
Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 166 | using the `--recurse-submodules=no` option). |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 167 | |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 168 | --submodule-prefix=<path>:: |
| 169 | Prepend <path> to paths printed in informative messages |
| 170 | such as "Fetching submodule foo". This option is used |
| 171 | internally when recursing over submodules. |
Junio C Hamano | 5cd1518 | 2011-04-05 00:21:10 | [diff] [blame] | 172 | |
| 173 | --recurse-submodules-default=[yes|on-demand]:: |
| 174 | This option is used internally to temporarily provide a |
| 175 | non-negative default value for the --recurse-submodules |
| 176 | option. All other methods of configuring fetch's submodule |
| 177 | recursion (such as settings in linkgit:gitmodules[5] and |
| 178 | linkgit:git-config[1]) override this option, as does |
| 179 | specifying --[no-]recurse-submodules directly. |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 180 | endif::git-pull[] |
| 181 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 182 | -u:: |
| 183 | --update-head-ok:: |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 184 | By default 'git fetch' refuses to update the head which |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 185 | corresponds to the current branch. This flag disables the |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 186 | check. This is purely for the internal use for 'git pull' |
| 187 | to communicate with 'git fetch', and unless you are |
Junio C Hamano | b288d9e | 2007-01-02 00:04:15 | [diff] [blame] | 188 | implementing your own Porcelain you are not supposed to |
| 189 | use it. |
| 190 | |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 191 | --upload-pack <upload-pack>:: |
| 192 | When given, and the repository to fetch from is handled |
Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 193 | by 'git fetch-pack', `--exec=<upload-pack>` is passed to |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 194 | the command to specify non-default path for the command |
| 195 | run on the other end. |
| 196 | |
| 197 | ifndef::git-pull[] |
| 198 | -q:: |
| 199 | --quiet:: |
| 200 | Pass --quiet to git-fetch-pack and silence any other internally |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 201 | used git commands. Progress is not reported to the standard error |
| 202 | stream. |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 203 | |
| 204 | -v:: |
| 205 | --verbose:: |
| 206 | Be verbose. |
| 207 | endif::git-pull[] |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 208 | |
| 209 | --progress:: |
| 210 | Progress status is reported on the standard error stream |
| 211 | by default when it is attached to a terminal, unless -q |
| 212 | is specified. This flag forces progress status even if the |
| 213 | standard error stream is not directed to a terminal. |
Junio C Hamano | 3fcdd07 | 2016-02-24 23:41:08 | [diff] [blame] | 214 | |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 215 | -o <option>:: |
| 216 | --server-option=<option>:: |
| 217 | Transmit the given string to the server when communicating using |
| 218 | protocol version 2. The given string must not contain a NUL or LF |
| 219 | character. |
| 220 | When multiple `--server-option=<option>` are given, they are all |
| 221 | sent to the other side in the order listed on the command line. |
| 222 | |
Junio C Hamano | 3fcdd07 | 2016-02-24 23:41:08 | [diff] [blame] | 223 | -4:: |
| 224 | --ipv4:: |
| 225 | Use IPv4 addresses only, ignoring IPv6 addresses. |
| 226 | |
| 227 | -6:: |
| 228 | --ipv6:: |
| 229 | Use IPv6 addresses only, ignoring IPv4 addresses. |