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