]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/fetch-options.txt
fetch: define shallow boundary with --shallow-since
[thirdparty/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
508ea882
NTND
17--shallow-since=<date>::
18 Deepen or shorten the history of a shallow repository to
19 include all reachable commits after <date>.
20
4dcb167f 21--unshallow::
79d3a236
NTND
22 If the source repository is complete, convert a shallow
23 repository to a complete one, removing all the limitations
24 imposed by shallow repositories.
25+
26If the source repository is shallow, fetch as much as possible so that
27the current repository has the same history as the source repository.
4dcb167f 28
48d25cae
NTND
29--update-shallow::
30 By default when fetching from a shallow repository,
31 `git fetch` refuses refs that require updating
32 .git/shallow. This option updates .git/shallow and accept such
33 refs.
4dcb167f 34
28a15401
JS
35ifndef::git-pull[]
36--dry-run::
37 Show what would be done, without making any changes.
38endif::git-pull[]
39
3240240f
SB
40-f::
41--force::
0b444cdb 42 When 'git fetch' is used with `<rbranch>:<lbranch>`
a3e3dc46
JH
43 refspec, it refuses to update the local branch
44 `<lbranch>` unless the remote branch `<rbranch>` it
45 fetches is a descendant of `<lbranch>`. This option
46 overrides that check.
93d69d86 47
6b276e19
JA
48-k::
49--keep::
50 Keep downloaded pack.
51
16679e37
BG
52ifndef::git-pull[]
53--multiple::
54 Allow several <repository> and <group> arguments to be
55 specified. No <refspec>s may be specified.
f360d844 56
1b79d1c2 57-p::
f360d844 58--prune::
0838bf47
MH
59 After fetching, remove any remote-tracking references that no
60 longer exist on the remote. Tags are not subject to pruning
61 if they are fetched only because of the default tag
62 auto-following or due to a --tags option. However, if tags
63 are fetched due to an explicit refspec (either on the command
64 line or in the remote configuration, for example if the remote
65 was cloned with the --mirror option), then they are also
66 subject to pruning.
16679e37
BG
67endif::git-pull[]
68
10eb64f5 69ifndef::git-pull[]
3240240f 70-n::
10eb64f5 71endif::git-pull[]
01ca90c2 72--no-tags::
10eb64f5
MV
73 By default, tags that point at objects that are downloaded
74 from the remote repository are fetched and stored locally.
ed368546 75 This option disables this automatic tag following. The default
da0005b8 76 behavior for a remote may be specified with the remote.<name>.tagOpt
ed368546 77 setting. See linkgit:git-config[1].
03febf99 78
2e5955f3 79ifndef::git-pull[]
c5558f80
JH
80--refmap=<refspec>::
81 When fetching refs listed on the command line, use the
82 specified refspec (can be given more than once) to map the
83 refs to remote-tracking branches, instead of the values of
84 `remote.*.fetch` configuration variables for the remote
85 repository. See section on "Configured Remote-tracking
86 Branches" for details.
87
3240240f
SB
88-t::
89--tags::
0838bf47
MH
90 Fetch all tags from the remote (i.e., fetch remote tags
91 `refs/tags/*` into local tags with the same name), in addition
92 to whatever else would otherwise be fetched. Using this
93 option alone does not subject tags to pruning, even if --prune
94 is used (though tags may be pruned anyway if they are also the
95 destination of an explicit refspec; see '--prune').
93d69d86 96
8f0700dd
JL
97--recurse-submodules[=yes|on-demand|no]::
98 This option controls if and under what conditions new commits of
99 populated submodules should be fetched too. It can be used as a
100 boolean option to completely disable recursion when set to 'no' or to
101 unconditionally recurse into all populated submodules when set to
102 'yes', which is the default when this option is used without any
103 value. Use 'on-demand' to only recurse into a populated submodule
104 when the superproject retrieves a commit that updates the submodule's
c16c3e40
JL
105 reference to a commit that isn't already in the local submodule
106 clone.
8f0700dd 107
62104ba1
SB
108-j::
109--jobs=<n>::
110 Number of parallel children to be used for fetching submodules.
111 Each will fetch from different submodules, such that fetching many
112 submodules will be faster. By default submodules will be fetched
113 one at a time.
114
8f0700dd
JL
115--no-recurse-submodules::
116 Disable recursive fetching of submodules (this has the same effect as
117 using the '--recurse-submodules=no' option).
7dce19d3 118
7dce19d3
JL
119--submodule-prefix=<path>::
120 Prepend <path> to paths printed in informative messages
121 such as "Fetching submodule foo". This option is used
122 internally when recursing over submodules.
88a21979
JL
123
124--recurse-submodules-default=[yes|on-demand]::
125 This option is used internally to temporarily provide a
126 non-negative default value for the --recurse-submodules
127 option. All other methods of configuring fetch's submodule
128 recursion (such as settings in linkgit:gitmodules[5] and
129 linkgit:git-config[1]) override this option, as does
130 specifying --[no-]recurse-submodules directly.
7dce19d3 131endif::git-pull[]
93d69d86 132
3240240f
SB
133-u::
134--update-head-ok::
0b444cdb 135 By default 'git fetch' refuses to update the head which
93d69d86 136 corresponds to the current branch. This flag disables the
0b444cdb
TR
137 check. This is purely for the internal use for 'git pull'
138 to communicate with 'git fetch', and unless you are
a597fb0e
JH
139 implementing your own Porcelain you are not supposed to
140 use it.
03febf99 141
6b276e19
JA
142--upload-pack <upload-pack>::
143 When given, and the repository to fetch from is handled
0b444cdb 144 by 'git fetch-pack', '--exec=<upload-pack>' is passed to
6b276e19
JA
145 the command to specify non-default path for the command
146 run on the other end.
147
148ifndef::git-pull[]
149-q::
150--quiet::
151 Pass --quiet to git-fetch-pack and silence any other internally
9839018e
TRC
152 used git commands. Progress is not reported to the standard error
153 stream.
6b276e19
JA
154
155-v::
156--verbose::
157 Be verbose.
158endif::git-pull[]
9839018e
TRC
159
160--progress::
161 Progress status is reported on the standard error stream
162 by default when it is attached to a terminal, unless -q
163 is specified. This flag forces progress status even if the
164 standard error stream is not directed to a terminal.