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