blob: fa0a3151b3f7e96ee61e65669e057e48ee053aae [file] [log] [blame]
Junio C Hamano9df0c662009-11-23 11:09:271--all::
2Fetch all remotes.
3
Junio C Hamanoeb415992008-06-08 22:49:474-a::
5--append::
Junio C Hamano1a4e8412005-12-27 08:17:236Append ref names and object names of fetched refs to the
7existing contents of `.git/FETCH_HEAD`. Without this
8option old data in `.git/FETCH_HEAD` will be overwritten.
9
Junio C Hamanoc21ab052009-10-31 04:03:5510--depth=<depth>::
Junio C Hamano4e6ba272016-01-20 23:23:1911Limit fetching to the specified number of commits from the tip of
12each remote branch history. If fetching to a 'shallow' repository
13created by `git clone` with `--depth=<depth>` option (see
14linkgit:git-clone[1]), deepen or shorten the history to the specified
15number of commits. Tags for the deepened commits are not fetched.
Junio C Hamanoe663a7a2006-01-25 12:37:2816
Junio C Hamano20829a42016-10-10 23:24:4417--deepen=<depth>::
18Similar to --depth, except it specifies the number of commits
19from the current shallow boundary instead of from the tip of
20each remote branch history.
21
22--shallow-since=<date>::
23Deepen or shorten the history of a shallow repository to
24include all reachable commits after <date>.
25
26--shallow-exclude=<revision>::
27Deepen or shorten the history of a shallow repository to
28exclude commits reachable from a specified remote branch or tag.
29This option can be specified multiple times.
30
Junio C Hamano0d1122e2013-02-01 21:37:0231--unshallow::
Junio C Hamano61525f92014-01-17 22:46:4932If the source repository is complete, convert a shallow
33repository to a complete one, removing all the limitations
34imposed by shallow repositories.
35+
36If the source repository is shallow, fetch as much as possible so that
37the current repository has the same history as the source repository.
38
39--update-shallow::
40By 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
43refs.
Junio C Hamano0d1122e2013-02-01 21:37:0244
Junio C Hamanof09b7cd2018-08-02 23:01:4545--negotiation-tip=<commit|glob>::
46By default, Git will report, to the server, commits reachable
47from all local refs to find common commits in an attempt to
48reduce the size of the to-be-received packfile. If specified,
49Git will only report commits reachable from the given tips.
50This is useful to speed up fetches when the user knows which
51local ref is likely to have commits in common with the
52upstream ref being fetched.
53+
54This option may be specified more than once; if so, Git will report
55commits reachable from any of the given commits.
56+
57The argument to this option may be a glob on ref names, a ref, or the (possibly
58abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying
59this option multiple times, one for each matching ref name.
Junio C Hamanobfd91f42018-08-17 22:21:1660+
61See also the `fetch.negotiationAlgorithm` configuration variable
62documented in linkgit:git-config[1].
Junio C Hamanof09b7cd2018-08-02 23:01:4563
Junio C Hamano9df0c662009-11-23 11:09:2764ifndef::git-pull[]
65--dry-run::
66Show what would be done, without making any changes.
67endif::git-pull[]
68
Junio C Hamanoeb415992008-06-08 22:49:4769-f::
70--force::
Junio C Hamano980e61e2018-09-17 22:45:5271When 'git fetch' is used with `<src>:<dst>` refspec it may
72refuse to update the local branch as discussed
73ifdef::git-pull[]
74in the `<refspec>` part of the linkgit:git-fetch[1]
75documentation.
76endif::git-pull[]
77ifndef::git-pull[]
78in the `<refspec>` part below.
79endif::git-pull[]
80This option overrides that check.
Junio C Hamano1a4e8412005-12-27 08:17:2381
Junio C Hamanoc21ab052009-10-31 04:03:5582-k::
83--keep::
84Keep downloaded pack.
85
Junio C Hamano9df0c662009-11-23 11:09:2786ifndef::git-pull[]
87--multiple::
88Allow several <repository> and <group> arguments to be
89specified. No <refspec>s may be specified.
90
Junio C Hamano70664a02010-07-13 22:48:0591-p::
Junio C Hamano9df0c662009-11-23 11:09:2792--prune::
Junio C Hamano042f2142016-06-27 18:05:0593Before fetching, remove any remote-tracking references that no
Junio C Hamano4c8f2d92013-12-13 00:55:4294longer exist on the remote. Tags are not subject to pruning
95if they are fetched only because of the default tag
96auto-following or due to a --tags option. However, if tags
97are fetched due to an explicit refspec (either on the command
98line or in the remote configuration, for example if the remote
99was cloned with the --mirror option), then they are also
Junio C Hamano664750f2018-03-06 23:25:44100subject to pruning. Supplying `--prune-tags` is a shorthand for
101providing the tag refspec.
102+
103See the PRUNING section below for more details.
104
105-P::
106--prune-tags::
107Before fetching, remove any local tags that no longer exist on
108the remote if `--prune` is enabled. This option should be used
109more carefully, unlike `--prune` it will remove any local
110references (local tags) that have been created. This option is
111a shorthand for providing the explicit tag refspec along with
112`--prune`, see the discussion about that in its documentation.
113+
114See the PRUNING section below for more details.
115
Junio C Hamano9df0c662009-11-23 11:09:27116endif::git-pull[]
117
Junio C Hamanof7bb6692008-01-27 08:23:46118ifndef::git-pull[]
Junio C Hamanoeb415992008-06-08 22:49:47119-n::
Junio C Hamanof7bb6692008-01-27 08:23:46120endif::git-pull[]
Junio C Hamano4c8f2d92013-12-13 00:55:42121--no-tags::
Junio C Hamanof7bb6692008-01-27 08:23:46122By default, tags that point at objects that are downloaded
123from the remote repository are fetched and stored locally.
Junio C Hamano075ae872010-09-01 18:43:07124This option disables this automatic tag following. The default
Junio C Hamano322c6242015-03-23 21:32:46125behavior for a remote may be specified with the remote.<name>.tagOpt
Junio C Hamano075ae872010-09-01 18:43:07126setting. See linkgit:git-config[1].
Junio C Hamano4d04a402006-01-09 00:53:28127
Junio C Hamano982eb112010-11-18 00:53:09128ifndef::git-pull[]
Junio C Hamano45f804f2014-06-20 22:24:49129--refmap=<refspec>::
130When fetching refs listed on the command line, use the
131specified refspec (can be given more than once) to map the
132refs to remote-tracking branches, instead of the values of
133`remote.*.fetch` configuration variables for the remote
134repository. See section on "Configured Remote-tracking
135Branches" for details.
136
Junio C Hamanoeb415992008-06-08 22:49:47137-t::
138--tags::
Junio C Hamano4c8f2d92013-12-13 00:55:42139Fetch all tags from the remote (i.e., fetch remote tags
140`refs/tags/*` into local tags with the same name), in addition
141to whatever else would otherwise be fetched. Using this
142option alone does not subject tags to pruning, even if --prune
143is used (though tags may be pruned anyway if they are also the
Junio C Hamano92d80372016-07-13 22:00:05144destination of an explicit refspec; see `--prune`).
Junio C Hamano1a4e8412005-12-27 08:17:23145
Junio C Hamano5cd15182011-04-05 00:21:10146--recurse-submodules[=yes|on-demand|no]::
147This option controls if and under what conditions new commits of
148populated submodules should be fetched too. It can be used as a
149boolean option to completely disable recursion when set to 'no' or to
150unconditionally recurse into all populated submodules when set to
151'yes', which is the default when this option is used without any
152value. Use 'on-demand' to only recurse into a populated submodule
153when the superproject retrieves a commit that updates the submodule's
154reference to a commit that isn't already in the local submodule
155clone.
156
Junio C Hamanoa7da1ba2016-01-13 00:19:45157-j::
158--jobs=<n>::
159Number of parallel children to be used for fetching submodules.
160Each will fetch from different submodules, such that fetching many
161submodules will be faster. By default submodules will be fetched
162one at a time.
163
Junio C Hamano5cd15182011-04-05 00:21:10164--no-recurse-submodules::
165Disable recursive fetching of submodules (this has the same effect as
Junio C Hamano92d80372016-07-13 22:00:05166using the `--recurse-submodules=no` option).
Junio C Hamano0d75e872010-12-17 06:57:26167
Junio C Hamano0d75e872010-12-17 06:57:26168--submodule-prefix=<path>::
169Prepend <path> to paths printed in informative messages
170such as "Fetching submodule foo". This option is used
171internally when recursing over submodules.
Junio C Hamano5cd15182011-04-05 00:21:10172
173--recurse-submodules-default=[yes|on-demand]::
174This option is used internally to temporarily provide a
175non-negative default value for the --recurse-submodules
176option. All other methods of configuring fetch's submodule
177recursion (such as settings in linkgit:gitmodules[5] and
178linkgit:git-config[1]) override this option, as does
179specifying --[no-]recurse-submodules directly.
Junio C Hamano0d75e872010-12-17 06:57:26180endif::git-pull[]
181
Junio C Hamanoeb415992008-06-08 22:49:47182-u::
183--update-head-ok::
Junio C Hamano1aa40d22010-01-21 17:46:43184By default 'git fetch' refuses to update the head which
Junio C Hamano1a4e8412005-12-27 08:17:23185corresponds to the current branch. This flag disables the
Junio C Hamano1aa40d22010-01-21 17:46:43186check. This is purely for the internal use for 'git pull'
187to communicate with 'git fetch', and unless you are
Junio C Hamanob288d9e2007-01-02 00:04:15188implementing your own Porcelain you are not supposed to
189use it.
190
Junio C Hamanoc21ab052009-10-31 04:03:55191--upload-pack <upload-pack>::
192When given, and the repository to fetch from is handled
Junio C Hamano92d80372016-07-13 22:00:05193by 'git fetch-pack', `--exec=<upload-pack>` is passed to
Junio C Hamanoc21ab052009-10-31 04:03:55194the command to specify non-default path for the command
195run on the other end.
196
197ifndef::git-pull[]
198-q::
199--quiet::
200Pass --quiet to git-fetch-pack and silence any other internally
Junio C Hamanoea90ab32010-03-15 20:32:55201used git commands. Progress is not reported to the standard error
202stream.
Junio C Hamanoc21ab052009-10-31 04:03:55203
204-v::
205--verbose::
206Be verbose.
207endif::git-pull[]
Junio C Hamanoea90ab32010-03-15 20:32:55208
209--progress::
210Progress status is reported on the standard error stream
211by default when it is attached to a terminal, unless -q
212is specified. This flag forces progress status even if the
213standard error stream is not directed to a terminal.
Junio C Hamano3fcdd072016-02-24 23:41:08214
Junio C Hamanob9d9d902018-05-23 07:07:42215-o <option>::
216--server-option=<option>::
217Transmit the given string to the server when communicating using
218protocol version 2. The given string must not contain a NUL or LF
219character.
220When multiple `--server-option=<option>` are given, they are all
221sent to the other side in the order listed on the command line.
222
Junio C Hamano3fcdd072016-02-24 23:41:08223-4::
224--ipv4::
225Use IPv4 addresses only, ignoring IPv6 addresses.
226
227-6::
228--ipv6::
229Use IPv6 addresses only, ignoring IPv4 addresses.