push doc: correct lies about how push refspecs work
[git/git.git] / Documentation / fetch-options.txt
CommitLineData
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+
36If the source repository is shallow, fetch as much as possible so that
37the 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
28a15401
JS
45ifndef::git-pull[]
46--dry-run::
47 Show what would be done, without making any changes.
48endif::git-pull[]
49
3240240f
SB
50-f::
51--force::
0b444cdb 52 When 'git fetch' is used with `<rbranch>:<lbranch>`
a3e3dc46
JH
53 refspec, it refuses to update the local branch
54 `<lbranch>` unless the remote branch `<rbranch>` it
55 fetches is a descendant of `<lbranch>`. This option
56 overrides that check.
93d69d86 57
6b276e19
JA
58-k::
59--keep::
60 Keep downloaded pack.
61
16679e37
BG
62ifndef::git-pull[]
63--multiple::
64 Allow several <repository> and <group> arguments to be
65 specified. No <refspec>s may be specified.
f360d844 66
1b79d1c2 67-p::
f360d844 68--prune::
9e70233a 69 Before fetching, remove any remote-tracking references that no
0838bf47
MH
70 longer exist on the remote. Tags are not subject to pruning
71 if they are fetched only because of the default tag
72 auto-following or due to a --tags option. However, if tags
73 are fetched due to an explicit refspec (either on the command
74 line or in the remote configuration, for example if the remote
75 was cloned with the --mirror option), then they are also
97716d21
ÆAB
76 subject to pruning. Supplying `--prune-tags` is a shorthand for
77 providing the tag refspec.
78+
79See the PRUNING section below for more details.
80
81-P::
82--prune-tags::
83 Before fetching, remove any local tags that no longer exist on
84 the remote if `--prune` is enabled. This option should be used
85 more carefully, unlike `--prune` it will remove any local
86 references (local tags) that have been created. This option is
87 a shorthand for providing the explicit tag refspec along with
88 `--prune`, see the discussion about that in its documentation.
627a129b
ÆAB
89+
90See the PRUNING section below for more details.
91
16679e37
BG
92endif::git-pull[]
93
10eb64f5 94ifndef::git-pull[]
3240240f 95-n::
10eb64f5 96endif::git-pull[]
01ca90c2 97--no-tags::
10eb64f5
MV
98 By default, tags that point at objects that are downloaded
99 from the remote repository are fetched and stored locally.
ed368546 100 This option disables this automatic tag following. The default
da0005b8 101 behavior for a remote may be specified with the remote.<name>.tagOpt
ed368546 102 setting. See linkgit:git-config[1].
03febf99 103
2e5955f3 104ifndef::git-pull[]
c5558f80
JH
105--refmap=<refspec>::
106 When fetching refs listed on the command line, use the
107 specified refspec (can be given more than once) to map the
108 refs to remote-tracking branches, instead of the values of
109 `remote.*.fetch` configuration variables for the remote
110 repository. See section on "Configured Remote-tracking
111 Branches" for details.
112
3240240f
SB
113-t::
114--tags::
0838bf47
MH
115 Fetch all tags from the remote (i.e., fetch remote tags
116 `refs/tags/*` into local tags with the same name), in addition
117 to whatever else would otherwise be fetched. Using this
118 option alone does not subject tags to pruning, even if --prune
119 is used (though tags may be pruned anyway if they are also the
bcf9626a 120 destination of an explicit refspec; see `--prune`).
93d69d86 121
8f0700dd
JL
122--recurse-submodules[=yes|on-demand|no]::
123 This option controls if and under what conditions new commits of
124 populated submodules should be fetched too. It can be used as a
125 boolean option to completely disable recursion when set to 'no' or to
126 unconditionally recurse into all populated submodules when set to
127 'yes', which is the default when this option is used without any
128 value. Use 'on-demand' to only recurse into a populated submodule
129 when the superproject retrieves a commit that updates the submodule's
c16c3e40
JL
130 reference to a commit that isn't already in the local submodule
131 clone.
8f0700dd 132
62104ba1
SB
133-j::
134--jobs=<n>::
135 Number of parallel children to be used for fetching submodules.
136 Each will fetch from different submodules, such that fetching many
137 submodules will be faster. By default submodules will be fetched
138 one at a time.
139
8f0700dd
JL
140--no-recurse-submodules::
141 Disable recursive fetching of submodules (this has the same effect as
bcf9626a 142 using the `--recurse-submodules=no` option).
7dce19d3 143
7dce19d3
JL
144--submodule-prefix=<path>::
145 Prepend <path> to paths printed in informative messages
146 such as "Fetching submodule foo". This option is used
147 internally when recursing over submodules.
88a21979
JL
148
149--recurse-submodules-default=[yes|on-demand]::
150 This option is used internally to temporarily provide a
151 non-negative default value for the --recurse-submodules
152 option. All other methods of configuring fetch's submodule
153 recursion (such as settings in linkgit:gitmodules[5] and
154 linkgit:git-config[1]) override this option, as does
155 specifying --[no-]recurse-submodules directly.
7dce19d3 156endif::git-pull[]
93d69d86 157
3240240f
SB
158-u::
159--update-head-ok::
0b444cdb 160 By default 'git fetch' refuses to update the head which
93d69d86 161 corresponds to the current branch. This flag disables the
0b444cdb
TR
162 check. This is purely for the internal use for 'git pull'
163 to communicate with 'git fetch', and unless you are
a597fb0e
JH
164 implementing your own Porcelain you are not supposed to
165 use it.
03febf99 166
6b276e19
JA
167--upload-pack <upload-pack>::
168 When given, and the repository to fetch from is handled
bcf9626a 169 by 'git fetch-pack', `--exec=<upload-pack>` is passed to
6b276e19
JA
170 the command to specify non-default path for the command
171 run on the other end.
172
173ifndef::git-pull[]
174-q::
175--quiet::
176 Pass --quiet to git-fetch-pack and silence any other internally
9839018e
TRC
177 used git commands. Progress is not reported to the standard error
178 stream.
6b276e19
JA
179
180-v::
181--verbose::
182 Be verbose.
183endif::git-pull[]
9839018e
TRC
184
185--progress::
186 Progress status is reported on the standard error stream
187 by default when it is attached to a terminal, unless -q
188 is specified. This flag forces progress status even if the
189 standard error stream is not directed to a terminal.
c915f11e 190
5e3548ef
BW
191-o <option>::
192--server-option=<option>::
193 Transmit the given string to the server when communicating using
194 protocol version 2. The given string must not contain a NUL or LF
195 character.
196 When multiple `--server-option=<option>` are given, they are all
197 sent to the other side in the order listed on the command line.
198
c915f11e
EW
199-4::
200--ipv4::
201 Use IPv4 addresses only, ignoring IPv6 addresses.
202
203-6::
204--ipv6::
205 Use IPv6 addresses only, ignoring IPv4 addresses.