fetch tests: add scaffolding for the new fetch.pruneTags
[git/git.git] / Documentation / fetch-options.txt
... / ...
CommitLineData
1--all::
2 Fetch all remotes.
3
4-a::
5--append::
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
10--depth=<depth>::
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.
16
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
31--unshallow::
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.
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.
44
45ifndef::git-pull[]
46--dry-run::
47 Show what would be done, without making any changes.
48endif::git-pull[]
49
50-f::
51--force::
52 When 'git fetch' is used with `<rbranch>:<lbranch>`
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.
57
58-k::
59--keep::
60 Keep downloaded pack.
61
62ifndef::git-pull[]
63--multiple::
64 Allow several <repository> and <group> arguments to be
65 specified. No <refspec>s may be specified.
66
67-p::
68--prune::
69 Before fetching, remove any remote-tracking references that no
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
76 subject to pruning.
77+
78See the PRUNING section below for more details.
79
80endif::git-pull[]
81
82ifndef::git-pull[]
83-n::
84endif::git-pull[]
85--no-tags::
86 By default, tags that point at objects that are downloaded
87 from the remote repository are fetched and stored locally.
88 This option disables this automatic tag following. The default
89 behavior for a remote may be specified with the remote.<name>.tagOpt
90 setting. See linkgit:git-config[1].
91
92ifndef::git-pull[]
93--refmap=<refspec>::
94 When fetching refs listed on the command line, use the
95 specified refspec (can be given more than once) to map the
96 refs to remote-tracking branches, instead of the values of
97 `remote.*.fetch` configuration variables for the remote
98 repository. See section on "Configured Remote-tracking
99 Branches" for details.
100
101-t::
102--tags::
103 Fetch all tags from the remote (i.e., fetch remote tags
104 `refs/tags/*` into local tags with the same name), in addition
105 to whatever else would otherwise be fetched. Using this
106 option alone does not subject tags to pruning, even if --prune
107 is used (though tags may be pruned anyway if they are also the
108 destination of an explicit refspec; see `--prune`).
109
110--recurse-submodules[=yes|on-demand|no]::
111 This option controls if and under what conditions new commits of
112 populated submodules should be fetched too. It can be used as a
113 boolean option to completely disable recursion when set to 'no' or to
114 unconditionally recurse into all populated submodules when set to
115 'yes', which is the default when this option is used without any
116 value. Use 'on-demand' to only recurse into a populated submodule
117 when the superproject retrieves a commit that updates the submodule's
118 reference to a commit that isn't already in the local submodule
119 clone.
120
121-j::
122--jobs=<n>::
123 Number of parallel children to be used for fetching submodules.
124 Each will fetch from different submodules, such that fetching many
125 submodules will be faster. By default submodules will be fetched
126 one at a time.
127
128--no-recurse-submodules::
129 Disable recursive fetching of submodules (this has the same effect as
130 using the `--recurse-submodules=no` option).
131
132--submodule-prefix=<path>::
133 Prepend <path> to paths printed in informative messages
134 such as "Fetching submodule foo". This option is used
135 internally when recursing over submodules.
136
137--recurse-submodules-default=[yes|on-demand]::
138 This option is used internally to temporarily provide a
139 non-negative default value for the --recurse-submodules
140 option. All other methods of configuring fetch's submodule
141 recursion (such as settings in linkgit:gitmodules[5] and
142 linkgit:git-config[1]) override this option, as does
143 specifying --[no-]recurse-submodules directly.
144endif::git-pull[]
145
146-u::
147--update-head-ok::
148 By default 'git fetch' refuses to update the head which
149 corresponds to the current branch. This flag disables the
150 check. This is purely for the internal use for 'git pull'
151 to communicate with 'git fetch', and unless you are
152 implementing your own Porcelain you are not supposed to
153 use it.
154
155--upload-pack <upload-pack>::
156 When given, and the repository to fetch from is handled
157 by 'git fetch-pack', `--exec=<upload-pack>` is passed to
158 the command to specify non-default path for the command
159 run on the other end.
160
161ifndef::git-pull[]
162-q::
163--quiet::
164 Pass --quiet to git-fetch-pack and silence any other internally
165 used git commands. Progress is not reported to the standard error
166 stream.
167
168-v::
169--verbose::
170 Be verbose.
171endif::git-pull[]
172
173--progress::
174 Progress status is reported on the standard error stream
175 by default when it is attached to a terminal, unless -q
176 is specified. This flag forces progress status even if the
177 standard error stream is not directed to a terminal.
178
179-4::
180--ipv4::
181 Use IPv4 addresses only, ignoring IPv6 addresses.
182
183-6::
184--ipv6::
185 Use IPv6 addresses only, ignoring IPv4 addresses.