Documentation / pull-fetch-param.txton commit t7501: add test of "commit --dry-run --short" (8282f59)
   1<repository>::
   2        The "remote" repository that is the source of a fetch
   3        or pull operation.  This parameter can be either a URL
   4        (see the section <<URLS,GIT URLS>> below) or the name
   5        of a remote (see the section <<REMOTES,REMOTES>> below).
   6
   7ifndef::git-pull[]
   8<group>::
   9        A name referring to a list of repositories as the value
  10        of remotes.<group> in the configuration file.
  11        (See linkgit:git-config[1]).
  12endif::git-pull[]
  13
  14<refspec>::
  15        Specifies which refs to fetch and which local refs to update.
  16        When no <refspec>s appear on the command line, the refs to fetch
  17        are read from `remote.<repository>.fetch` variables instead
  18ifndef::git-pull[]
  19        (see <<CRTB,CONFIGURED REMOTE-TRACKING BRANCHES>> below).
  20endif::git-pull[]
  21ifdef::git-pull[]
  22        (see linkgit:git-fetch[1]).
  23endif::git-pull[]
  24+
  25The format of a <refspec> parameter is an optional plus
  26`+`, followed by the source <src>, followed
  27by a colon `:`, followed by the destination ref <dst>.
  28The colon can be omitted when <dst> is empty.  <src> is
  29typically a ref, but it can also be a fully spelled hex object
  30name.
  31+
  32`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`;
  33it requests fetching everything up to the given tag.
  34+
  35The remote ref that matches <src>
  36is fetched, and if <dst> is not an empty string, the local
  37ref that matches it is fast-forwarded using <src>.
  38If the optional plus `+` is used, the local ref
  39is updated even if it does not result in a fast-forward
  40update.
  41+
  42[NOTE]
  43When the remote branch you want to fetch is known to
  44be rewound and rebased regularly, it is expected that
  45its new tip will not be descendant of its previous tip
  46(as stored in your remote-tracking branch the last time
  47you fetched).  You would want
  48to use the `+` sign to indicate non-fast-forward updates
  49will be needed for such branches.  There is no way to
  50determine or declare that a branch will be made available
  51in a repository with this behavior; the pulling user simply
  52must know this is the expected usage pattern for a branch.
  53ifdef::git-pull[]
  54+
  55[NOTE]
  56There is a difference between listing multiple <refspec>
  57directly on 'git pull' command line and having multiple
  58`remote.<repository>.fetch` entries in your configuration
  59for a <repository> and running a
  60'git pull' command without any explicit <refspec> parameters.
  61<refspec>s listed explicitly on the command line are always
  62merged into the current branch after fetching.  In other words,
  63if you list more than one remote ref, 'git pull' will create
  64an Octopus merge.  On the other hand, if you do not list any
  65explicit <refspec> parameter on the command line, 'git pull'
  66will fetch all the <refspec>s it finds in the
  67`remote.<repository>.fetch` configuration and merge
  68only the first <refspec> found into the current branch.
  69This is because making an
  70Octopus from remote refs is rarely done, while keeping track
  71of multiple remote heads in one-go by fetching more than one
  72is often useful.
  73endif::git-pull[]