Documentation / git-pull.txton commit Merge branch 'master' into sp/gfi (76db9de)
   1git-pull(1)
   2===========
   3
   4NAME
   5----
   6git-pull - Fetch from and merge with another repository or a local branch
   7
   8
   9SYNOPSIS
  10--------
  11'git-pull' <options> <repository> <refspec>...
  12
  13
  14DESCRIPTION
  15-----------
  16Runs `git-fetch` with the given parameters, and calls `git-merge`
  17to merge the retrieved head(s) into the current branch.
  18
  19Note that you can use `.` (current directory) as the
  20<repository> to pull from the local repository -- this is useful
  21when merging local branches into the current branch.
  22
  23
  24OPTIONS
  25-------
  26include::merge-options.txt[]
  27
  28include::fetch-options.txt[]
  29
  30include::pull-fetch-param.txt[]
  31
  32include::urls.txt[]
  33
  34include::merge-strategies.txt[]
  35
  36EXAMPLES
  37--------
  38
  39git pull, git pull origin::
  40        Update the remote-tracking branches for the repository
  41        you cloned from, then merge one of them into your
  42        current branch.  Normally the branch merged in is
  43        the HEAD of the remote repository, but the choice is
  44        determined by the branch.<name>.remote and
  45        branch.<name>.merge options; see gitlink:git-config[1]
  46        for details.
  47
  48git pull origin next::
  49        Merge into the current branch the remote branch `next`;
  50        leaves a copy of `next` temporarily in FETCH_HEAD, but
  51        does not update any remote-tracking branches.
  52
  53git pull . fixes enhancements::
  54        Bundle local branch `fixes` and `enhancements` on top of
  55        the current branch, making an Octopus merge.  This `git pull .`
  56        syntax is equivalent to `git merge`.
  57
  58git pull -s ours . obsolete::
  59        Merge local branch `obsolete` into the current branch,
  60        using `ours` merge strategy.
  61
  62git pull --no-commit . maint::
  63        Merge local branch `maint` into the current branch, but
  64        do not make a commit automatically.  This can be used
  65        when you want to include further changes to the merge,
  66        or want to write your own merge commit message.
  67+
  68You should refrain from abusing this option to sneak substantial
  69changes into a merge commit.  Small fixups like bumping
  70release/version name would be acceptable.
  71
  72Command line pull of multiple branches from one repository::
  73+
  74------------------------------------------------
  75$ git checkout master
  76$ git fetch origin +pu:pu maint:tmp
  77$ git pull . tmp
  78------------------------------------------------
  79+
  80This updates (or creates, as necessary) branches `pu` and `tmp`
  81in the local repository by fetching from the branches
  82(respectively) `pu` and `maint` from the remote repository.
  83+
  84The `pu` branch will be updated even if it is does not
  85fast-forward; the others will not be.
  86+
  87The final command then merges the newly fetched `tmp` into master.
  88
  89
  90If you tried a pull which resulted in a complex conflicts and
  91would want to start over, you can recover with
  92gitlink:git-reset[1].
  93
  94
  95SEE ALSO
  96--------
  97gitlink:git-fetch[1], gitlink:git-merge[1], gitlink:git-config[1]
  98
  99
 100Author
 101------
 102Written by Linus Torvalds <torvalds@osdl.org>
 103and Junio C Hamano <junkio@cox.net>
 104
 105Documentation
 106--------------
 107Documentation by Jon Loeliger,
 108David Greaves,
 109Junio C Hamano and the git-list <git@vger.kernel.org>.
 110
 111GIT
 112---
 113Part of the gitlink:git[7] suite
 114