blob: cf2254fc120aa559e21594b219d3c48288f4450c [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamano40f2f8d2006-02-07 08:04:396<meta name="generator" content="AsciiDoc 7.0.2" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
19a { color: blue; }
20a:visited { color: fuchsia; }
21
22em {
23 font-style: italic;
24}
25
26strong {
27 font-weight: bold;
28}
29
30tt {
31 color: navy;
32}
33
34h1, h2, h3, h4, h5, h6 {
35 color: #527bbd;
36 font-family: sans-serif;
37 margin-top: 1.2em;
38 margin-bottom: 0.5em;
39 line-height: 1.3;
40}
41
42h1 {
43 border-bottom: 2px solid silver;
44}
45h2 {
46 border-bottom: 2px solid silver;
47 padding-top: 0.5em;
48}
49
50div.sectionbody {
51 font-family: serif;
52 margin-left: 0;
53}
54
55hr {
56 border: 1px solid silver;
57}
58
59p {
60 margin-top: 0.5em;
61 margin-bottom: 0.5em;
62}
63
64pre {
65 padding: 0;
66 margin: 0;
67}
68
69span#author {
70 color: #527bbd;
71 font-family: sans-serif;
72 font-weight: bold;
73 font-size: 1.2em;
74}
75span#email {
76}
77span#revision {
78 font-family: sans-serif;
79}
80
81div#footer {
82 font-family: sans-serif;
83 font-size: small;
84 border-top: 2px solid silver;
85 padding-top: 0.5em;
86 margin-top: 4.0em;
87}
88div#footer-text {
89 float: left;
90 padding-bottom: 0.5em;
91}
92div#footer-badges {
93 float: right;
94 padding-bottom: 0.5em;
95}
96
97div#preamble,
98div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
99div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
100div.admonitionblock {
101 margin-right: 10%;
102 margin-top: 1.5em;
103 margin-bottom: 1.5em;
104}
105div.admonitionblock {
106 margin-top: 2.5em;
107 margin-bottom: 2.5em;
108}
109
110div.content { /* Block element content. */
111 padding: 0;
112}
113
114/* Block element titles. */
115div.title, caption.title {
116 font-family: sans-serif;
117 font-weight: bold;
118 text-align: left;
119 margin-top: 1.0em;
120 margin-bottom: 0.5em;
121}
122div.title + * {
123 margin-top: 0;
124}
125
126td div.title:first-child {
127 margin-top: 0.0em;
128}
129div.content div.title:first-child {
130 margin-top: 0.0em;
131}
132div.content + div.title {
133 margin-top: 0.0em;
134}
135
136div.sidebarblock > div.content {
137 background: #ffffee;
138 border: 1px solid silver;
139 padding: 0.5em;
140}
141
142div.listingblock > div.content {
143 border: 1px solid silver;
144 background: #f4f4f4;
145 padding: 0.5em;
146}
147
148div.quoteblock > div.content {
149 padding-left: 2.0em;
150}
151div.quoteblock .attribution {
152 text-align: right;
153}
154
155div.admonitionblock .icon {
156 vertical-align: top;
157 font-size: 1.1em;
158 font-weight: bold;
159 text-decoration: underline;
160 color: #527bbd;
161 padding-right: 0.5em;
162}
163div.admonitionblock td.content {
164 padding-left: 0.5em;
165 border-left: 2px solid silver;
166}
167
168div.exampleblock > div.content {
169 border-left: 2px solid silver;
170 padding: 0.5em;
171}
172
173div.verseblock div.content {
174 white-space: pre;
175}
176
177div.imageblock div.content { padding-left: 0; }
178div.imageblock img { border: 1px solid silver; }
179span.image img { border-style: none; }
180
181dl {
182 margin-top: 0.8em;
183 margin-bottom: 0.8em;
184}
185dt {
186 margin-top: 0.5em;
187 margin-bottom: 0;
188 font-style: italic;
189}
190dd > *:first-child {
191 margin-top: 0;
192}
193
194ul, ol {
195 list-style-position: outside;
196}
197ol.olist2 {
198 list-style-type: lower-alpha;
199}
200
201div.tableblock > table {
202 border-color: #527bbd;
203 border-width: 3px;
204}
205thead {
206 font-family: sans-serif;
207 font-weight: bold;
208}
209tfoot {
210 font-weight: bold;
211}
212
213div.hlist {
214 margin-top: 0.8em;
215 margin-bottom: 0.8em;
216}
217td.hlist1 {
218 vertical-align: top;
219 font-style: italic;
220 padding-right: 0.8em;
221}
222td.hlist2 {
223 vertical-align: top;
224}
225
226@media print {
227 div#footer-badges { display: none; }
228}
229include::./stylesheets/xhtml11-manpage.css[]
230/* Workarounds for IE6's broken and incomplete CSS2. */
231
232div.sidebar-content {
233 background: #ffffee;
234 border: 1px solid silver;
235 padding: 0.5em;
236}
237div.sidebar-title, div.image-title {
238 font-family: sans-serif;
239 font-weight: bold;
240 margin-top: 0.0em;
241 margin-bottom: 0.5em;
242}
243
244div.listingblock div.content {
245 border: 1px solid silver;
246 background: #f4f4f4;
247 padding: 0.5em;
248}
249
250div.quoteblock-content {
251 padding-left: 2.0em;
252}
253
254div.exampleblock-content {
255 border-left: 2px solid silver;
256 padding-left: 0.5em;
257}
258</style>
259<title>git-pull(1)</title>
260</head>
261<body>
262<div id="header">
263<h1>
264git-pull(1) Manual Page
265</h1>
266<h2>NAME</h2>
267<div class="sectionbody">
268<p>git-pull -
Junio C Hamano01078922006-03-10 00:31:47269 Pull and merge from another repository
Junio C Hamano1a4e8412005-12-27 08:17:23270</p>
271</div>
272</div>
273<h2>SYNOPSIS</h2>
274<div class="sectionbody">
275<p><em>git-pull</em> &lt;options&gt; &lt;repository&gt; &lt;refspec&gt;&#8230;</p>
276</div>
277<h2>DESCRIPTION</h2>
278<div class="sectionbody">
279<p>Runs <tt>git-fetch</tt> with the given parameters, and calls <tt>git-merge</tt>
280to merge the retrieved head(s) into the current branch.</p>
281<p>Note that you can use <tt>.</tt> (current directory) as the
282&lt;repository&gt; to pull from the local repository &#8212; this is useful
283when merging local branches into the current branch.</p>
284</div>
285<h2>OPTIONS</h2>
286<div class="sectionbody">
287<dl>
288<dt>
289-n, --no-summary
290</dt>
291<dd>
292<p>
293 Do not show diffstat at the end of the merge.
294</p>
295</dd>
296<dt>
297--no-commit
298</dt>
299<dd>
300<p>
301 Perform the merge but pretend the merge failed and do
302 not autocommit, to give the user a chance to inspect and
303 further tweak the merge result before committing.
304</p>
305</dd>
306<dt>
Junio C Hamano3901ffb2006-06-26 23:46:53307--squash
308</dt>
309<dd>
310<p>
311 Produce the working tree and index state as if a real
312 merge happened, but do not actually make a commit or
313 move the <tt>HEAD</tt>, nor record <tt>$GIT_DIR/MERGE_HEAD</tt> to
314 cause the next <tt>git commit</tt> command to create a merge
315 commit. This allows you to create a single commit on
316 top of the current branch whose effect is the same as
317 merging another branch (or more in case of an octopus).
318</p>
319</dd>
320<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23321-s &lt;strategy&gt;, --strategy=&lt;strategy&gt;
322</dt>
323<dd>
324<p>
325 Use the given merge strategy; can be supplied more than
326 once to specify them in the order they should be tried.
327 If there is no <tt>-s</tt> option, a built-in list of strategies
328 is used instead (<tt>git-merge-recursive</tt> when merging a single
329 head, <tt>git-merge-octopus</tt> otherwise).
330</p>
331</dd>
332<dt>
333-a, --append
334</dt>
335<dd>
336<p>
337 Append ref names and object names of fetched refs to the
338 existing contents of <tt>.git/FETCH_HEAD</tt>. Without this
339 option old data in <tt>.git/FETCH_HEAD</tt> will be overwritten.
340</p>
341</dd>
342<dt>
Junio C Hamanoe663a7a2006-01-25 12:37:28343--upload-pack &lt;upload-pack&gt;
344</dt>
Junio C Hamanoe663a7a2006-01-25 12:37:28345<dd>
346<p>
347 When given, and the repository to fetch from is handled
348 by <em>git-fetch-pack</em>, <em>--exec=&lt;upload-pack&gt;</em> is passed to
349 the command to specify non-default path for the command
350 run on the other end.
351</p>
352</dd>
353<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23354-f, --force
355</dt>
356<dd>
357<p>
358 When <tt>git-fetch</tt> is used with <tt>&lt;rbranch&gt;:&lt;lbranch&gt;</tt>
359 refspec, it refuses to update the local branch
360 <tt>&lt;lbranch&gt;</tt> unless the remote branch <tt>&lt;rbranch&gt;</tt> it
361 fetches is a descendant of <tt>&lt;lbranch&gt;</tt>. This option
362 overrides that check.
363</p>
364</dd>
365<dt>
Junio C Hamano4d04a402006-01-09 00:53:28366--no-tags
367</dt>
368<dd>
369<p>
370 By default, <tt>git-fetch</tt> fetches tags that point at
371 objects that are downloaded from the remote repository
372 and stores them locally. This option disables this
373 automatic tag following.
374</p>
375</dd>
376<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23377-t, --tags
378</dt>
379<dd>
380<p>
Junio C Hamano4d04a402006-01-09 00:53:28381 Most of the tags are fetched automatically as branch
382 heads are downloaded, but tags that do not point at
383 objects reachable from the branch heads that are being
384 tracked will not be fetched by this mechanism. This
385 flag lets all tags and their associated objects be
386 downloaded.
Junio C Hamano1a4e8412005-12-27 08:17:23387</p>
388</dd>
389<dt>
Junio C Hamanob6bdc742006-01-11 11:35:32390-k, --keep
391</dt>
392<dd>
393<p>
394 Keep downloaded pack.
395</p>
396</dd>
397<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23398-u, --update-head-ok
399</dt>
400<dd>
401<p>
402 By default <tt>git-fetch</tt> refuses to update the head which
403 corresponds to the current branch. This flag disables the
404 check. Note that fetching into the current branch will not
405 update the index and working directory, so use it with care.
406</p>
407</dd>
408<dt>
409&lt;repository&gt;
410</dt>
411<dd>
412<p>
413 The "remote" repository that is the source of a fetch
Junio C Hamano40f2f8d2006-02-07 08:04:39414 or pull operation. See the section <a href="#URLS">GIT URLS</a> below.
Junio C Hamano1a4e8412005-12-27 08:17:23415</p>
Junio C Hamano40f2f8d2006-02-07 08:04:39416</dd>
417<dt>
418&lt;refspec&gt;
419</dt>
420<dd>
421<p>
422 The canonical format of a &lt;refspec&gt; parameter is
423 <tt>+?&lt;src&gt;:&lt;dst&gt;</tt>; that is, an optional plus <tt>+</tt>, followed
424 by the source ref, followed by a colon <tt>:</tt>, followed by
425 the destination ref.
426</p>
427<p>The remote ref that matches &lt;src&gt;
428is fetched, and if &lt;dst&gt; is not empty string, the local
429ref that matches it is fast forwarded using &lt;src&gt;.
430Again, if the optional plus <tt>+</tt> is used, the local ref
431is updated even if it does not result in a fast forward
432update.</p>
433<div class="admonitionblock">
434<table><tr>
435<td class="icon">
436<div class="title">Note</div>
437</td>
438<td class="content">If the remote branch from which you want to pull is
439modified in non-linear ways such as being rewound and
440rebased frequently, then a pull will attempt a merge with
441an older version of itself, likely conflict, and fail.
442It is under these conditions that you would want to use
443the <tt>+</tt> sign to indicate non-fast-forward updates will
444be needed. There is currently no easy way to determine
445or declare that a branch will be made available in a
446repository with this behavior; the pulling user simply
447must know this is the expected usage pattern for a branch.</td>
448</tr></table>
449</div>
450<div class="admonitionblock">
451<table><tr>
452<td class="icon">
453<div class="title">Note</div>
454</td>
455<td class="content">You never do your own development on branches that appear
456on the right hand side of a &lt;refspec&gt; colon on <tt>Pull:</tt> lines;
457they are to be updated by <tt>git-fetch</tt>. If you intend to do
458development derived from a remote branch <tt>B</tt>, have a <tt>Pull:</tt>
459line to track it (i.e. <tt>Pull: B:remote-B</tt>), and have a separate
460branch <tt>my-B</tt> to do your development on top of it. The latter
461is created by <tt>git branch my-B remote-B</tt> (or its equivalent <tt>git
462checkout -b my-B remote-B</tt>). Run <tt>git fetch</tt> to keep track of
463the progress of the remote side, and when you see something new
464on the remote branch, merge it into your development branch with
465<tt>git pull . remote-B</tt>, while you are on <tt>my-B</tt> branch.
466The common <tt>Pull: master:origin</tt> mapping of a remote <tt>master</tt>
467branch to a local <tt>origin</tt> branch, which is then merged to a
468local development branch, again typically named <tt>master</tt>, is made
469when you run <tt>git clone</tt> for you to follow this pattern.</td>
470</tr></table>
471</div>
472<div class="admonitionblock">
473<table><tr>
474<td class="icon">
475<div class="title">Note</div>
476</td>
477<td class="content">There is a difference between listing multiple &lt;refspec&gt;
478directly on <tt>git-pull</tt> command line and having multiple
479<tt>Pull:</tt> &lt;refspec&gt; lines for a &lt;repository&gt; and running
480<tt>git-pull</tt> command without any explicit &lt;refspec&gt; parameters.
481&lt;refspec&gt; listed explicitly on the command line are always
482merged into the current branch after fetching. In other words,
483if you list more than one remote refs, you would be making
484an Octopus. While <tt>git-pull</tt> run without any explicit &lt;refspec&gt;
485parameter takes default &lt;refspec&gt;s from <tt>Pull:</tt> lines, it
486merges only the first &lt;refspec&gt; found into the current branch,
487after fetching all the remote refs. This is because making an
488Octopus from remote refs is rarely done, while keeping track
489of multiple remote heads in one-go by fetching more than one
490is often useful.</td>
491</tr></table>
492</div>
493<p>Some short-cut notations are also supported.</p>
494<ul>
495<li>
496<p>
497<tt>tag &lt;tag&gt;</tt> means the same as <tt>refs/tags/&lt;tag&gt;:refs/tags/&lt;tag&gt;</tt>;
498 it requests fetching everything up to the given tag.
499</p>
500</li>
501<li>
502<p>
503A parameter &lt;ref&gt; without a colon is equivalent to
504 &lt;ref&gt;: when pulling/fetching, so it merges &lt;ref&gt; into the current
505 branch without storing the remote branch anywhere locally
506</p>
507</li>
508</ul>
509</dd>
510</dl>
511</div>
512<h2>GIT URLS<a id="URLS"></a></h2>
513<div class="sectionbody">
514<p>One of the following notations can be used
515to name the remote repository:</p>
Junio C Hamano1a4e8412005-12-27 08:17:23516<div class="exampleblock">
517<div class="exampleblock-content">
518<ul>
519<li>
520<p>
521rsync://host.xz/path/to/repo.git/
522</p>
523</li>
524<li>
525<p>
526http://host.xz/path/to/repo.git/
527</p>
528</li>
529<li>
530<p>
531https://host.xz/path/to/repo.git/
532</p>
533</li>
534<li>
535<p>
536git://host.xz/path/to/repo.git/
537</p>
538</li>
539<li>
540<p>
541git://host.xz/~user/path/to/repo.git/
542</p>
543</li>
544<li>
545<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40546ssh://&#91;user@&#93;host.xz/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:23547</p>
548</li>
549<li>
550<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40551ssh://&#91;user@&#93;host.xz/~user/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:23552</p>
553</li>
554<li>
555<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40556ssh://&#91;user@&#93;host.xz/~/path/to/repo.git
Junio C Hamano1a4e8412005-12-27 08:17:23557</p>
558</li>
559</ul>
560</div></div>
Junio C Hamano7ccb9fd2006-07-15 01:38:40561<p>SSH is the default transport protocol. You can optionally specify
562which user to log-in as, and an alternate, scp-like syntax is also
563supported. Both syntaxes support username expansion,
Junio C Hamano1a4e8412005-12-27 08:17:23564as does the native git protocol. The following three are
565identical to the last three above, respectively:</p>
566<div class="exampleblock">
567<div class="exampleblock-content">
568<ul>
569<li>
570<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40571&#91;user@&#93;host.xz:/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:23572</p>
573</li>
574<li>
575<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40576&#91;user@&#93;host.xz:~user/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:23577</p>
578</li>
579<li>
580<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40581&#91;user@&#93;host.xz:path/to/repo.git
Junio C Hamano1a4e8412005-12-27 08:17:23582</p>
583</li>
584</ul>
585</div></div>
586<p>To sync with a local directory, use:</p>
587<div class="exampleblock">
588<div class="exampleblock-content">
589<ul>
590<li>
591<p>
592/path/to/repo.git/
593</p>
594</li>
595</ul>
596</div></div>
Junio C Hamano40f2f8d2006-02-07 08:04:39597</div>
598<h2>REMOTES</h2>
599<div class="sectionbody">
Junio C Hamano1a4e8412005-12-27 08:17:23600<p>In addition to the above, as a short-hand, the name of a
601file in <tt>$GIT_DIR/remotes</tt> directory can be given; the
602named file should be in the following format:</p>
603<div class="literalblock">
604<div class="content">
605<pre><tt>URL: one of the above URL format
606Push: &lt;refspec&gt;
607Pull: &lt;refspec&gt;</tt></pre>
608</div></div>
Junio C Hamano40f2f8d2006-02-07 08:04:39609<p>Then such a short-hand is specified in place of
Junio C Hamano1a4e8412005-12-27 08:17:23610&lt;repository&gt; without &lt;refspec&gt; parameters on the command
611line, &lt;refspec&gt; specified on <tt>Push:</tt> lines or <tt>Pull:</tt>
612lines are used for <tt>git-push</tt> and <tt>git-fetch</tt>/<tt>git-pull</tt>,
Junio C Hamano51c2ab02006-07-09 20:38:54613respectively. Multiple <tt>Push:</tt> and <tt>Pull:</tt> lines may
Junio C Hamano1a4e8412005-12-27 08:17:23614be specified for additional branch mappings.</p>
615<p>The name of a file in <tt>$GIT_DIR/branches</tt> directory can be
616specified as an older notation short-hand; the named
617file should contain a single line, a URL in one of the
618above formats, optionally followed by a hash <tt>#</tt> and the
619name of remote head (URL fragment notation).
620<tt>$GIT_DIR/branches/&lt;remote&gt;</tt> file that stores a &lt;url&gt;
621without the fragment is equivalent to have this in the
622corresponding file in the <tt>$GIT_DIR/remotes/</tt> directory.</p>
623<div class="literalblock">
624<div class="content">
625<pre><tt>URL: &lt;url&gt;
626Pull: refs/heads/master:&lt;remote&gt;</tt></pre>
627</div></div>
628<p>while having <tt>&lt;url&gt;#&lt;head&gt;</tt> is equivalent to</p>
629<div class="literalblock">
630<div class="content">
631<pre><tt>URL: &lt;url&gt;
632Pull: refs/heads/&lt;head&gt;:&lt;remote&gt;</tt></pre>
633</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23634</div>
635<h2>MERGE STRATEGIES</h2>
636<div class="sectionbody">
637<dl>
638<dt>
639resolve
640</dt>
641<dd>
642<p>
643 This can only resolve two heads (i.e. the current branch
644 and another branch you pulled from) using 3-way merge
645 algorithm. It tries to carefully detect criss-cross
646 merge ambiguities and is considered generally safe and
647 fast.
648</p>
649</dd>
650<dt>
651recursive
652</dt>
653<dd>
654<p>
655 This can only resolve two heads using 3-way merge
656 algorithm. When there are more than one common
657 ancestors that can be used for 3-way merge, it creates a
658 merged tree of the common ancestors and uses that as
659 the reference tree for the 3-way merge. This has been
660 reported to result in fewer merge conflicts without
661 causing mis-merges by tests done on actual merge commits
662 taken from Linux 2.6 kernel development history.
663 Additionally this can detect and handle merges involving
664 renames. This is the default merge strategy when
665 pulling or merging one branch.
666</p>
667</dd>
668<dt>
669octopus
670</dt>
671<dd>
672<p>
673 This resolves more than two-head case, but refuses to do
674 complex merge that needs manual resolution. It is
675 primarily meant to be used for bundling topic branch
676 heads together. This is the default merge strategy when
677 pulling or merging more than one branches.
678</p>
679</dd>
680<dt>
681ours
682</dt>
683<dd>
684<p>
685 This resolves any number of heads, but the result of the
686 merge is always the current branch head. It is meant to
687 be used to supersede old development history of side
688 branches.
689</p>
690</dd>
691</dl>
692</div>
693<h2>EXAMPLES</h2>
694<div class="sectionbody">
695<dl>
696<dt>
697git pull, git pull origin
698</dt>
699<dd>
700<p>
701 Fetch the default head from the repository you cloned
702 from and merge it into your current branch.
703</p>
704</dd>
705<dt>
706git pull -s ours . obsolete
707</dt>
708<dd>
709<p>
710 Merge local branch <tt>obsolete</tt> into the current branch,
711 using <tt>ours</tt> merge strategy.
712</p>
713</dd>
714<dt>
715git pull . fixes enhancements
716</dt>
717<dd>
718<p>
719 Bundle local branch <tt>fixes</tt> and <tt>enhancements</tt> on top of
720 the current branch, making an Octopus merge.
721</p>
722</dd>
723<dt>
724git pull --no-commit . maint
725</dt>
726<dd>
727<p>
728 Merge local branch <tt>maint</tt> into the current branch, but
729 do not make a commit automatically. This can be used
730 when you want to include further changes to the merge,
731 or want to write your own merge commit message.
732</p>
733<p>You should refrain from abusing this option to sneak substantial
734changes into a merge commit. Small fixups like bumping
735release/version name would be acceptable.</p>
736</dd>
737<dt>
738Command line pull of multiple branches from one repository
739</dt>
740<dd>
741<div class="listingblock">
742<div class="content">
743<pre><tt>$ cat .git/remotes/origin
744URL: git://git.kernel.org/pub/scm/git/git.git
745Pull: master:origin
746
747$ git checkout master
748$ git fetch origin master:origin +pu:pu maint:maint
749$ git pull . origin</tt></pre>
750</div></div>
751<p>Here, a typical <tt>.git/remotes/origin</tt> file from a
752<tt>git-clone</tt> operation is used in combination with
753command line options to <tt>git-fetch</tt> to first update
754multiple branches of the local repository and then
755to merge the remote <tt>origin</tt> branch into the local
756<tt>master</tt> branch. The local <tt>pu</tt> branch is updated
757even if it does not result in a fast forward update.
758Here, the pull can obtain its objects from the local
759repository using <tt>.</tt>, as the previous <tt>git-fetch</tt> is
760known to have already obtained and made available
761all the necessary objects.</p>
762</dd>
763<dt>
764Pull of multiple branches from one repository using <tt>.git/remotes</tt> file
765</dt>
766<dd>
767<div class="listingblock">
768<div class="content">
769<pre><tt>$ cat .git/remotes/origin
770URL: git://git.kernel.org/pub/scm/git/git.git
771Pull: master:origin
772Pull: +pu:pu
773Pull: maint:maint
774
775$ git checkout master
776$ git pull origin</tt></pre>
777</div></div>
778<p>Here, a typical <tt>.git/remotes/origin</tt> file from a
779<tt>git-clone</tt> operation has been hand-modified to include
780the branch-mapping of additional remote and local
781heads directly. A single <tt>git-pull</tt> operation while
782in the <tt>master</tt> branch will fetch multiple heads and
783merge the remote <tt>origin</tt> head into the current,
784local <tt>master</tt> branch.</p>
785</dd>
786</dl>
787<p>If you tried a pull which resulted in a complex conflicts and
788would want to start over, you can recover with
789<a href="git-reset.html">git-reset(1)</a>.</p>
790</div>
791<h2>SEE ALSO</h2>
792<div class="sectionbody">
793<p><a href="git-fetch.html">git-fetch(1)</a>, <a href="git-merge.html">git-merge(1)</a></p>
794</div>
795<h2>Author</h2>
796<div class="sectionbody">
797<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;
798and Junio C Hamano &lt;junkio@cox.net&gt;</p>
799</div>
800<h2>Documentation</h2>
801<div class="sectionbody">
802<p>Documentation by Jon Loeliger,
803David Greaves,
804Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p>
805</div>
806<h2>GIT</h2>
807<div class="sectionbody">
808<p>Part of the <a href="git.html">git(7)</a> suite</p>
809</div>
810<div id="footer">
811<div id="footer-text">
Junio C Hamanod97409f2006-10-03 08:41:56812Last updated 03-Oct-2006 08:41:18 UTC
Junio C Hamano1a4e8412005-12-27 08:17:23813</div>
814</div>
815</body>
816</html>