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