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