git/Documentation: fix SYNOPSIS style bugs
[git/jnareb-git.git] / Documentation / git-pull.txt
blob20175f4b9a71c0299c57aab9f6c4452fb05cc53f
1 git-pull(1)
2 ===========
4 NAME
5 ----
6 git-pull - Pull and merge from another repository.
9 SYNOPSIS
10 --------
11 'git-pull' <options> <repository> <refspec>...
14 DESCRIPTION
15 -----------
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.
24 OPTIONS
25 -------
26 include::merge-options.txt[]
28 include::fetch-options.txt[]
30 include::pull-fetch-param.txt[]
32 include::urls.txt[]
34 include::merge-strategies.txt[]
36 EXAMPLES
37 --------
39 git pull, git pull origin::
40         Fetch the default head from the repository you cloned
41         from and merge it into your current branch.
43 git pull -s ours . obsolete::
44         Merge local branch `obsolete` into the current branch,
45         using `ours` merge strategy.
47 git pull . fixes enhancements::
48         Bundle local branch `fixes` and `enhancements` on top of
49         the current branch, making an Octopus merge.
51 git pull --no-commit . maint::
52         Merge local branch `maint` into the current branch, but
53         do not make a commit automatically.  This can be used
54         when you want to include further changes to the merge,
55         or want to write your own merge commit message.
57 You should refrain from abusing this option to sneak substantial
58 changes into a merge commit.  Small fixups like bumping
59 release/version name would be acceptable.
61 Command line pull of multiple branches from one repository::
63 ------------------------------------------------
64 $ cat .git/remotes/origin
65 URL: git://git.kernel.org/pub/scm/git/git.git
66 Pull: master:origin
68 $ git checkout master
69 $ git fetch origin master:origin +pu:pu maint:maint
70 $ git pull . origin
71 ------------------------------------------------
73 Here, a typical `.git/remotes/origin` file from a
74 `git-clone` operation is used in combination with
75 command line options to `git-fetch` to first update
76 multiple branches of the local repository and then
77 to merge the remote `origin` branch into the local
78 `master` branch.  The local `pu` branch is updated
79 even if it does not result in a fast forward update.
80 Here, the pull can obtain its objects from the local
81 repository using `.`, as the previous `git-fetch` is
82 known to have already obtained and made available
83 all the necessary objects.
86 Pull of multiple branches from one repository using `.git/remotes` file::
88 ------------------------------------------------
89 $ cat .git/remotes/origin
90 URL: git://git.kernel.org/pub/scm/git/git.git
91 Pull: master:origin
92 Pull: +pu:pu
93 Pull: maint:maint
95 $ git checkout master
96 $ git pull origin
97 ------------------------------------------------
99 Here, a typical `.git/remotes/origin` file from a
100 `git-clone` operation has been hand-modified to include
101 the branch-mapping of additional remote and local
102 heads directly.  A single `git-pull` operation while
103 in the `master` branch will fetch multiple heads and
104 merge the remote `origin` head into the current,
105 local `master` branch.
108 If you tried a pull which resulted in a complex conflicts and
109 would want to start over, you can recover with
110 gitlink:git-reset[1].
113 SEE ALSO
114 --------
115 gitlink:git-fetch[1], gitlink:git-merge[1]
118 Author
119 ------
120 Written by Linus Torvalds <torvalds@osdl.org>
121 and Junio C Hamano <junkio@cox.net>
123 Documentation
124 --------------
125 Documentation by Jon Loeliger,
126 David Greaves,
127 Junio C Hamano and the git-list <git@vger.kernel.org>.
131 Part of the gitlink:git[7] suite