Autogenerated HTML docs for v1.3.2-g45f7
[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.2" />\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 <dd>\r
332 <p>\r
333         When given, and the repository to fetch from is handled\r
334         by <em>git-fetch-pack</em>, <em>--exec=&lt;upload-pack&gt;</em> is passed to\r
335         the command to specify non-default path for the command\r
336         run on the other end.\r
337 </p>\r
338 </dd>\r
339 <dt>\r
340 -f, --force\r
341 </dt>\r
342 <dd>\r
343 <p>\r
344         When <tt>git-fetch</tt> is used with <tt>&lt;rbranch&gt;:&lt;lbranch&gt;</tt>\r
345         refspec, it refuses to update the local branch\r
346         <tt>&lt;lbranch&gt;</tt> unless the remote branch <tt>&lt;rbranch&gt;</tt> it\r
347         fetches is a descendant of <tt>&lt;lbranch&gt;</tt>.  This option\r
348         overrides that check.\r
349 </p>\r
350 </dd>\r
351 <dt>\r
352 --no-tags\r
353 </dt>\r
354 <dd>\r
355 <p>\r
356         By default, <tt>git-fetch</tt> fetches tags that point at\r
357         objects that are downloaded from the remote repository\r
358         and stores them locally.  This option disables this\r
359         automatic tag following.\r
360 </p>\r
361 </dd>\r
362 <dt>\r
363 -t, --tags\r
364 </dt>\r
365 <dd>\r
366 <p>\r
367         Most of the tags are fetched automatically as branch\r
368         heads are downloaded, but tags that do not point at\r
369         objects reachable from the branch heads that are being\r
370         tracked will not be fetched by this mechanism.  This\r
371         flag lets all tags and their associated objects be\r
372         downloaded.\r
373 </p>\r
374 </dd>\r
375 <dt>\r
376 -k, --keep\r
377 </dt>\r
378 <dd>\r
379 <p>\r
380         Keep downloaded pack.\r
381 </p>\r
382 </dd>\r
383 <dt>\r
384 -u, --update-head-ok\r
385 </dt>\r
386 <dd>\r
387 <p>\r
388         By default <tt>git-fetch</tt> refuses to update the head which\r
389         corresponds to the current branch.  This flag disables the\r
390         check.  Note that fetching into the current branch will not\r
391         update the index and working directory, so use it with care.\r
392 </p>\r
393 </dd>\r
394 <dt>\r
395 &lt;repository&gt;\r
396 </dt>\r
397 <dd>\r
398 <p>\r
399         The "remote" repository that is the source of a fetch\r
400         or pull operation.  See the section <a href="#URLS">GIT URLS</a> below.\r
401 </p>\r
402 </dd>\r
403 <dt>\r
404 &lt;refspec&gt;\r
405 </dt>\r
406 <dd>\r
407 <p>\r
408         The canonical format of a &lt;refspec&gt; parameter is\r
409         <tt>+?&lt;src&gt;:&lt;dst&gt;</tt>; that is, an optional plus <tt>+</tt>, followed\r
410         by the source ref, followed by a colon <tt>:</tt>, followed by\r
411         the destination ref.\r
412 </p>\r
413 <p>The remote ref that matches &lt;src&gt;\r
414 is fetched, and if &lt;dst&gt; is not empty string, the local\r
415 ref that matches it is fast forwarded using &lt;src&gt;.\r
416 Again, if the optional plus <tt>+</tt> is used, the local ref\r
417 is updated even if it does not result in a fast forward\r
418 update.</p>\r
419 <div class="admonitionblock">\r
420 <table><tr>\r
421 <td class="icon">\r
422 <div class="title">Note</div>\r
423 </td>\r
424 <td class="content">If the remote branch from which you want to pull is\r
425 modified in non-linear ways such as being rewound and\r
426 rebased frequently, then a pull will attempt a merge with\r
427 an older version of itself, likely conflict, and fail.\r
428 It is under these conditions that you would want to use\r
429 the <tt>+</tt> sign to indicate non-fast-forward updates will\r
430 be needed.  There is currently no easy way to determine\r
431 or declare that a branch will be made available in a\r
432 repository with this behavior; the pulling user simply\r
433 must know this is the expected usage pattern for a branch.</td>\r
434 </tr></table>\r
435 </div>\r
436 <div class="admonitionblock">\r
437 <table><tr>\r
438 <td class="icon">\r
439 <div class="title">Note</div>\r
440 </td>\r
441 <td class="content">You never do your own development on branches that appear\r
442 on the right hand side of a &lt;refspec&gt; colon on <tt>Pull:</tt> lines;\r
443 they are to be updated by <tt>git-fetch</tt>.  If you intend to do\r
444 development derived from a remote branch <tt>B</tt>, have a <tt>Pull:</tt>\r
445 line to track it (i.e. <tt>Pull: B:remote-B</tt>), and have a separate\r
446 branch <tt>my-B</tt> to do your development on top of it.  The latter\r
447 is created by <tt>git branch my-B remote-B</tt> (or its equivalent <tt>git\r
448 checkout -b my-B remote-B</tt>).  Run <tt>git fetch</tt> to keep track of\r
449 the progress of the remote side, and when you see something new\r
450 on the remote branch, merge it into your development branch with\r
451 <tt>git pull . remote-B</tt>, while you are on <tt>my-B</tt> branch.\r
452 The common <tt>Pull: master:origin</tt> mapping of a remote <tt>master</tt>\r
453 branch to a local <tt>origin</tt> branch, which is then merged to a\r
454 local development branch, again typically named <tt>master</tt>, is made\r
455 when you run <tt>git clone</tt> for you to follow this pattern.</td>\r
456 </tr></table>\r
457 </div>\r
458 <div class="admonitionblock">\r
459 <table><tr>\r
460 <td class="icon">\r
461 <div class="title">Note</div>\r
462 </td>\r
463 <td class="content">There is a difference between listing multiple &lt;refspec&gt;\r
464 directly on <tt>git-pull</tt> command line and having multiple\r
465 <tt>Pull:</tt> &lt;refspec&gt; lines for a &lt;repository&gt; and running\r
466 <tt>git-pull</tt> command without any explicit &lt;refspec&gt; parameters.\r
467 &lt;refspec&gt; listed explicitly on the command line are always\r
468 merged into the current branch after fetching.  In other words,\r
469 if you list more than one remote refs, you would be making\r
470 an Octopus.  While <tt>git-pull</tt> run without any explicit &lt;refspec&gt;\r
471 parameter takes default &lt;refspec&gt;s from <tt>Pull:</tt> lines, it\r
472 merges only the first &lt;refspec&gt; found into the current branch,\r
473 after fetching all the remote refs.  This is because making an\r
474 Octopus from remote refs is rarely done, while keeping track\r
475 of multiple remote heads in one-go by fetching more than one\r
476 is often useful.</td>\r
477 </tr></table>\r
478 </div>\r
479 <p>Some short-cut notations are also supported.</p>\r
480 <ul>\r
481 <li>\r
482 <p>\r
483 <tt>tag &lt;tag&gt;</tt> means the same as <tt>refs/tags/&lt;tag&gt;:refs/tags/&lt;tag&gt;</tt>;\r
484   it requests fetching everything up to the given tag.\r
485 </p>\r
486 </li>\r
487 <li>\r
488 <p>\r
489 A parameter &lt;ref&gt; without a colon is equivalent to\r
490   &lt;ref&gt;: when pulling/fetching, so it merges &lt;ref&gt; into the current\r
491   branch without storing the remote branch anywhere locally\r
492 </p>\r
493 </li>\r
494 </ul>\r
495 </dd>\r
496 </dl>\r
497 </div>\r
498 <h2>GIT URLS<a id="URLS"></a></h2>\r
499 <div class="sectionbody">\r
500 <p>One of the following notations can be used\r
501 to name the remote repository:</p>\r
502 <div class="exampleblock">\r
503 <div class="exampleblock-content">\r
504 <ul>\r
505 <li>\r
506 <p>\r
507 rsync://host.xz/path/to/repo.git/\r
508 </p>\r
509 </li>\r
510 <li>\r
511 <p>\r
512 http://host.xz/path/to/repo.git/\r
513 </p>\r
514 </li>\r
515 <li>\r
516 <p>\r
517 https://host.xz/path/to/repo.git/\r
518 </p>\r
519 </li>\r
520 <li>\r
521 <p>\r
522 git://host.xz/path/to/repo.git/\r
523 </p>\r
524 </li>\r
525 <li>\r
526 <p>\r
527 git://host.xz/~user/path/to/repo.git/\r
528 </p>\r
529 </li>\r
530 <li>\r
531 <p>\r
532 ssh://host.xz/path/to/repo.git/\r
533 </p>\r
534 </li>\r
535 <li>\r
536 <p>\r
537 ssh://host.xz/~user/path/to/repo.git/\r
538 </p>\r
539 </li>\r
540 <li>\r
541 <p>\r
542 ssh://host.xz/~/path/to/repo.git\r
543 </p>\r
544 </li>\r
545 </ul>\r
546 </div></div>\r
547 <p>SSH Is the default transport protocol and also supports an\r
548 scp-like syntax.  Both syntaxes support username expansion,\r
549 as does the native git protocol. The following three are\r
550 identical to the last three above, respectively:</p>\r
551 <div class="exampleblock">\r
552 <div class="exampleblock-content">\r
553 <ul>\r
554 <li>\r
555 <p>\r
556 host.xz:/path/to/repo.git/\r
557 </p>\r
558 </li>\r
559 <li>\r
560 <p>\r
561 host.xz:~user/path/to/repo.git/\r
562 </p>\r
563 </li>\r
564 <li>\r
565 <p>\r
566 host.xz:path/to/repo.git\r
567 </p>\r
568 </li>\r
569 </ul>\r
570 </div></div>\r
571 <p>To sync with a local directory, use:</p>\r
572 <div class="exampleblock">\r
573 <div class="exampleblock-content">\r
574 <ul>\r
575 <li>\r
576 <p>\r
577 /path/to/repo.git/\r
578 </p>\r
579 </li>\r
580 </ul>\r
581 </div></div>\r
582 </div>\r
583 <h2>REMOTES</h2>\r
584 <div class="sectionbody">\r
585 <p>In addition to the above, as a short-hand, the name of a\r
586 file in <tt>$GIT_DIR/remotes</tt> directory can be given; the\r
587 named file should be in the following format:</p>\r
588 <div class="literalblock">\r
589 <div class="content">\r
590 <pre><tt>URL: one of the above URL format\r
591 Push: &lt;refspec&gt;\r
592 Pull: &lt;refspec&gt;</tt></pre>\r
593 </div></div>\r
594 <p>Then such a short-hand is specified in place of\r
595 &lt;repository&gt; without &lt;refspec&gt; parameters on the command\r
596 line, &lt;refspec&gt; specified on <tt>Push:</tt> lines or <tt>Pull:</tt>\r
597 lines are used for <tt>git-push</tt> and <tt>git-fetch</tt>/<tt>git-pull</tt>,\r
598 respectively.  Multiple <tt>Push:</tt> and and <tt>Pull:</tt> lines may\r
599 be specified for additional branch mappings.</p>\r
600 <p>The name of a file in <tt>$GIT_DIR/branches</tt> directory can be\r
601 specified as an older notation short-hand; the named\r
602 file should contain a single line, a URL in one of the\r
603 above formats, optionally followed by a hash <tt>#</tt> and the\r
604 name of remote head (URL fragment notation).\r
605 <tt>$GIT_DIR/branches/&lt;remote&gt;</tt> file that stores a &lt;url&gt;\r
606 without the fragment is equivalent to have this in the\r
607 corresponding file in the <tt>$GIT_DIR/remotes/</tt> directory.</p>\r
608 <div class="literalblock">\r
609 <div class="content">\r
610 <pre><tt>URL: &lt;url&gt;\r
611 Pull: refs/heads/master:&lt;remote&gt;</tt></pre>\r
612 </div></div>\r
613 <p>while having <tt>&lt;url&gt;#&lt;head&gt;</tt> is equivalent to</p>\r
614 <div class="literalblock">\r
615 <div class="content">\r
616 <pre><tt>URL: &lt;url&gt;\r
617 Pull: refs/heads/&lt;head&gt;:&lt;remote&gt;</tt></pre>\r
618 </div></div>\r
619 </div>\r
620 <h2>MERGE STRATEGIES</h2>\r
621 <div class="sectionbody">\r
622 <dl>\r
623 <dt>\r
624 resolve\r
625 </dt>\r
626 <dd>\r
627 <p>\r
628         This can only resolve two heads (i.e. the current branch\r
629         and another branch you pulled from) using 3-way merge\r
630         algorithm.  It tries to carefully detect criss-cross\r
631         merge ambiguities and is considered generally safe and\r
632         fast.\r
633 </p>\r
634 </dd>\r
635 <dt>\r
636 recursive\r
637 </dt>\r
638 <dd>\r
639 <p>\r
640         This can only resolve two heads using 3-way merge\r
641         algorithm.  When there are more than one common\r
642         ancestors that can be used for 3-way merge, it creates a\r
643         merged tree of the common ancestors and uses that as\r
644         the reference tree for the 3-way merge.  This has been\r
645         reported to result in fewer merge conflicts without\r
646         causing mis-merges by tests done on actual merge commits\r
647         taken from Linux 2.6 kernel development history.\r
648         Additionally this can detect and handle merges involving\r
649         renames.  This is the default merge strategy when\r
650         pulling or merging one branch.\r
651 </p>\r
652 </dd>\r
653 <dt>\r
654 octopus\r
655 </dt>\r
656 <dd>\r
657 <p>\r
658         This resolves more than two-head case, but refuses to do\r
659         complex merge that needs manual resolution.  It is\r
660         primarily meant to be used for bundling topic branch\r
661         heads together.  This is the default merge strategy when\r
662         pulling or merging more than one branches.\r
663 </p>\r
664 </dd>\r
665 <dt>\r
666 ours\r
667 </dt>\r
668 <dd>\r
669 <p>\r
670         This resolves any number of heads, but the result of the\r
671         merge is always the current branch head.  It is meant to\r
672         be used to supersede old development history of side\r
673         branches.\r
674 </p>\r
675 </dd>\r
676 </dl>\r
677 </div>\r
678 <h2>EXAMPLES</h2>\r
679 <div class="sectionbody">\r
680 <dl>\r
681 <dt>\r
682 git pull, git pull origin\r
683 </dt>\r
684 <dd>\r
685 <p>\r
686         Fetch the default head from the repository you cloned\r
687         from and merge it into your current branch.\r
688 </p>\r
689 </dd>\r
690 <dt>\r
691 git pull -s ours . obsolete\r
692 </dt>\r
693 <dd>\r
694 <p>\r
695         Merge local branch <tt>obsolete</tt> into the current branch,\r
696         using <tt>ours</tt> merge strategy.\r
697 </p>\r
698 </dd>\r
699 <dt>\r
700 git pull . fixes enhancements\r
701 </dt>\r
702 <dd>\r
703 <p>\r
704         Bundle local branch <tt>fixes</tt> and <tt>enhancements</tt> on top of\r
705         the current branch, making an Octopus merge.\r
706 </p>\r
707 </dd>\r
708 <dt>\r
709 git pull --no-commit . maint\r
710 </dt>\r
711 <dd>\r
712 <p>\r
713         Merge local branch <tt>maint</tt> into the current branch, but\r
714         do not make a commit automatically.  This can be used\r
715         when you want to include further changes to the merge,\r
716         or want to write your own merge commit message.\r
717 </p>\r
718 <p>You should refrain from abusing this option to sneak substantial\r
719 changes into a merge commit.  Small fixups like bumping\r
720 release/version name would be acceptable.</p>\r
721 </dd>\r
722 <dt>\r
723 Command line pull of multiple branches from one repository\r
724 </dt>\r
725 <dd>\r
726 <div class="listingblock">\r
727 <div class="content">\r
728 <pre><tt>$ cat .git/remotes/origin\r
729 URL: git://git.kernel.org/pub/scm/git/git.git\r
730 Pull: master:origin\r
731 \r
732 $ git checkout master\r
733 $ git fetch origin master:origin +pu:pu maint:maint\r
734 $ git pull . origin</tt></pre>\r
735 </div></div>\r
736 <p>Here, a typical <tt>.git/remotes/origin</tt> file from a\r
737 <tt>git-clone</tt> operation is used in combination with\r
738 command line options to <tt>git-fetch</tt> to first update\r
739 multiple branches of the local repository and then\r
740 to merge the remote <tt>origin</tt> branch into the local\r
741 <tt>master</tt> branch.  The local <tt>pu</tt> branch is updated\r
742 even if it does not result in a fast forward update.\r
743 Here, the pull can obtain its objects from the local\r
744 repository using <tt>.</tt>, as the previous <tt>git-fetch</tt> is\r
745 known to have already obtained and made available\r
746 all the necessary objects.</p>\r
747 </dd>\r
748 <dt>\r
749 Pull of multiple branches from one repository using <tt>.git/remotes</tt> file\r
750 </dt>\r
751 <dd>\r
752 <div class="listingblock">\r
753 <div class="content">\r
754 <pre><tt>$ cat .git/remotes/origin\r
755 URL: git://git.kernel.org/pub/scm/git/git.git\r
756 Pull: master:origin\r
757 Pull: +pu:pu\r
758 Pull: maint:maint\r
759 \r
760 $ git checkout master\r
761 $ git pull origin</tt></pre>\r
762 </div></div>\r
763 <p>Here, a typical <tt>.git/remotes/origin</tt> file from a\r
764 <tt>git-clone</tt> operation has been hand-modified to include\r
765 the branch-mapping of additional remote and local\r
766 heads directly.  A single <tt>git-pull</tt> operation while\r
767 in the <tt>master</tt> branch will fetch multiple heads and\r
768 merge the remote <tt>origin</tt> head into the current,\r
769 local <tt>master</tt> branch.</p>\r
770 </dd>\r
771 </dl>\r
772 <p>If you tried a pull which resulted in a complex conflicts and\r
773 would want to start over, you can recover with\r
774 <a href="git-reset.html">git-reset(1)</a>.</p>\r
775 </div>\r
776 <h2>SEE ALSO</h2>\r
777 <div class="sectionbody">\r
778 <p><a href="git-fetch.html">git-fetch(1)</a>, <a href="git-merge.html">git-merge(1)</a></p>\r
779 </div>\r
780 <h2>Author</h2>\r
781 <div class="sectionbody">\r
782 <p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;\r
783 and Junio C Hamano &lt;junkio@cox.net&gt;</p>\r
784 </div>\r
785 <h2>Documentation</h2>\r
786 <div class="sectionbody">\r
787 <p>Documentation by Jon Loeliger,\r
788 David Greaves,\r
789 Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p>\r
790 </div>\r
791 <h2>GIT</h2>\r
792 <div class="sectionbody">\r
793 <p>Part of the <a href="git.html">git(7)</a> suite</p>\r
794 </div>\r
795 <div id="footer">\r
796 <div id="footer-text">\r
797 Last updated 10-Mar-2006 00:31:31 UTC\r
798 </div>\r
799 </div>\r
800 </body>\r
801 </html>\r