Document git-ls-files --directory
[git/dscho.git] / Documentation / git-pull.txt
blob3a7d385225754d5c865ac333a5a65e71c4e7fb65
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::merge-strategies.txt[]
35 EXAMPLES
36 --------
38 git pull, git pull origin::
39         Fetch the default head from the repository you cloned
40         from and merge it into your current branch.
42 git pull -s ours . obsolete::
43         Merge local branch `obsolete` into the current branch,
44         using `ours` merge strategy.
46 git pull . fixes enhancements::
47         Bundle local branch `fixes` and `enhancements` on top of
48         the current branch, making an Octopus merge.
50 git pull --no-commit . maint::
51         Merge local branch `maint` into the current branch, but
52         do not make a commit automatically.  This can be used
53         when you want to include further changes to the merge,
54         or want to write your own merge commit message.
56 You should refrain from abusing this option to sneak substantial
57 changes into a merge commit.  Small fixups like bumping
58 release/version name would be acceptable.
60 Command line pull of multiple branches from one repository::
62 ------------------------------------------------
63 $ cat .git/remotes/origin
64 URL: git://git.kernel.org/pub/scm/git/git.git
65 Pull: master:origin
67 $ git checkout master
68 $ git fetch origin master:origin +pu:pu maint:maint
69 $ git pull . origin
70 ------------------------------------------------
72 Here, a typical `.git/remotes/origin` file from a
73 `git-clone` operation is used in combination with
74 command line options to `git-fetch` to first update
75 multiple branches of the local repository and then
76 to merge the remote `origin` branch into the local
77 `master` branch.  The local `pu` branch is updated
78 even if it does not result in a fast forward update.
79 Here, the pull can obtain its objects from the local
80 repository using `.`, as the previous `git-fetch` is
81 known to have already obtained and made available
82 all the necessary objects.
85 Pull of multiple branches from one repository using `.git/remotes` file::
87 ------------------------------------------------
88 $ cat .git/remotes/origin
89 URL: git://git.kernel.org/pub/scm/git/git.git
90 Pull: master:origin
91 Pull: +pu:pu
92 Pull: maint:maint
94 $ git checkout master
95 $ git pull origin
96 ------------------------------------------------
98 Here, a typical `.git/remotes/origin` file from a
99 `git-clone` operation has been hand-modified to include
100 the branch-mapping of additional remote and local
101 heads directly.  A single `git-pull` operation while
102 in the `master` branch will fetch multiple heads and
103 merge the remote `origin` head into the current,
104 local `master` branch.
107 If you tried a pull which resulted in a complex conflicts and
108 would want to start over, you can recover with
109 gitlink:git-reset[1].
112 SEE ALSO
113 --------
114 gitlink:git-fetch[1], gitlink:git-merge[1]
117 Author
118 ------
119 Written by Linus Torvalds <torvalds@osdl.org>
120 and Junio C Hamano <junkio@cox.net>
122 Documentation
123 --------------
124 Documentation by Jon Loeliger,
125 David Greaves,
126 Junio C Hamano and the git-list <git@vger.kernel.org>.
130 Part of the gitlink:git[7] suite