6 git-pull - Fetch from and merge with another repository or a local branch
11 'git-pull' <options> <repository> <refspec>...
16 Runs `git-fetch` with the given parameters, and calls `git-merge`
17 to merge the retrieved head(s) into the current branch.
19 Note that you can use `.` (current directory) as the
20 <repository> to pull from the local repository -- this is useful
21 when merging local branches into the current branch.
26 include::merge-options.txt[]
28 include::fetch-options.txt[]
30 include::pull-fetch-param.txt[]
34 include::merge-strategies.txt[]
39 git 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-repo-config[1]
48 git 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.
53 git 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`.
58 git pull -s ours . obsolete::
59 Merge local branch `obsolete` into the current branch,
60 using `ours` merge strategy.
62 git 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.
68 You should refrain from abusing this option to sneak substantial
69 changes into a merge commit. Small fixups like bumping
70 release/version name would be acceptable.
72 Command line pull of multiple branches from one repository::
74 ------------------------------------------------
76 $ git fetch origin +pu:pu maint:tmp
78 ------------------------------------------------
80 This updates (or creates, as necessary) branches `pu` and `tmp`
81 in the local repository by fetching from the branches
82 (respectively) `pu` and `maint` from the remote repository.
84 The `pu` branch will be updated even if it is does not
85 fast-forward; the others will not be.
87 The final command then merges the newly fetched `tmp` into master.
90 If you tried a pull which resulted in a complex conflicts and
91 would want to start over, you can recover with
97 gitlink:git-fetch[1], gitlink:git-merge[1], gitlink:git-repo-config[1]
102 Written by Linus Torvalds <torvalds@osdl.org>
103 and Junio C Hamano <junkio@cox.net>
107 Documentation by Jon Loeliger,
109 Junio C Hamano and the git-list <git@vger.kernel.org>.
113 Part of the gitlink:git[7] suite