Autogenerated HTML docs for v1.7.7-419-g87009
[git/jnareb-git.git] / git-pull.html
blob84c7cf6ccbbb346c6c4d08aadca8ed318a082975
1 <!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" />
6 <meta name="generator" content="AsciiDoc 8.5.2" />
7 <title>git-pull(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.0em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
131 div.content { /* Block element content. */
132 padding: 0;
135 /* Block element titles. */
136 div.title, caption.title {
137 color: #527bbd;
138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
144 div.title + * {
145 margin-top: 0;
148 td div.title:first-child {
149 margin-top: 0.0em;
151 div.content div.title:first-child {
152 margin-top: 0.0em;
154 div.content + div.title {
155 margin-top: 0.0em;
158 div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
164 div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
170 div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
173 margin-right: 10%;
174 border-left: 5px solid #dddddd;
175 color: #777777;
178 div.quoteblock > div.attribution {
179 padding-top: 0.5em;
180 text-align: right;
183 div.verseblock > div.content {
184 white-space: pre;
186 div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div.verseblock + div.attribution {
192 text-align: left;
195 div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
203 div.admonitionblock td.content {
204 padding-left: 0.5em;
205 border-left: 3px solid #dddddd;
208 div.exampleblock > div.content {
209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
213 div.imageblock div.content { padding-left: 0; }
214 span.image img { border-style: none; }
215 a.image:visited { color: white; }
217 dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
221 dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
224 font-style: normal;
225 color: navy;
227 dd > *:first-child {
228 margin-top: 0.1em;
231 ul, ol {
232 list-style-position: outside;
234 ol.arabic {
235 list-style-type: decimal;
237 ol.loweralpha {
238 list-style-type: lower-alpha;
240 ol.upperalpha {
241 list-style-type: upper-alpha;
243 ol.lowerroman {
244 list-style-type: lower-roman;
246 ol.upperroman {
247 list-style-type: upper-roman;
250 div.compact ul, div.compact ol,
251 div.compact p, div.compact p,
252 div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
257 div.tableblock > table {
258 border: 3px solid #527bbd;
260 thead, p.table.header {
261 font-family: sans-serif;
262 font-weight: bold;
264 tfoot {
265 font-weight: bold;
267 td > div.verse {
268 white-space: pre;
270 p.table {
271 margin-top: 0;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div.tableblock > table[frame="void"] {
275 border-style: none;
277 div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
281 div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
287 div.hdlist {
288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
291 div.hdlist tr {
292 padding-bottom: 15px;
294 dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
297 td.hdlist1 {
298 vertical-align: top;
299 font-style: normal;
300 padding-right: 0.8em;
301 color: navy;
303 td.hdlist2 {
304 vertical-align: top;
306 div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
311 .comment {
312 background: yellow;
315 .footnote, .footnoteref {
316 font-size: 0.8em;
319 span.footnote, span.footnoteref {
320 vertical-align: super;
323 #footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
328 #footnotes div.footnote {
329 margin: 0 0 5px 0;
332 #footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
343 @media print {
344 div#footer-badges { display: none; }
347 div#toc {
348 margin-bottom: 2.5em;
351 div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
360 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
364 div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
368 div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
372 div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
376 /* Overrides for manpage documents */
377 h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
383 h2 {
384 border-style: none;
386 div.sectionbody {
387 margin-left: 5%;
390 @media print {
391 div#toc { display: none; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
401 div.sidebar-title, div.image-title {
402 color: #527bbd;
403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
409 div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
415 div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
420 div.verseblock-content {
421 white-space: pre;
423 div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
428 div.exampleblock-content {
429 border-left: 3px solid #dddddd;
430 padding-left: 0.5em;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc a:visited { color: blue; }
435 </style>
436 <script type="text/javascript">
437 /*<![CDATA[*/
438 window.onload = function(){asciidoc.footnotes();}
439 var asciidoc = { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
449 * Version: 0.4
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
458 // toclevels = 1..4.
459 toc: function (toclevels) {
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
469 return text;
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
491 iterate(i);
495 iterate(el);
496 return result;
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
567 /*]]>*/
568 </script>
569 </head>
570 <body>
571 <div id="header">
572 <h1>
573 git-pull(1) Manual Page
574 </h1>
575 <h2>NAME</h2>
576 <div class="sectionbody">
577 <p>git-pull -
578 Fetch from and merge with another repository or a local branch
579 </p>
580 </div>
581 </div>
582 <div id="content">
583 <h2 id="_synopsis">SYNOPSIS</h2>
584 <div class="sectionbody">
585 <div class="verseblock">
586 <div class="verseblock-content"><em>git pull</em> [options] [&lt;repository&gt; [&lt;refspec&gt;&#8230;]]</div>
587 <div class="verseblock-attribution">
588 </div></div>
589 </div>
590 <h2 id="_description">DESCRIPTION</h2>
591 <div class="sectionbody">
592 <div class="paragraph"><p>Incorporates changes from a remote repository into the current
593 branch. In its default mode, <tt>git pull</tt> is shorthand for
594 <tt>git fetch</tt> followed by <tt>git merge FETCH_HEAD</tt>.</p></div>
595 <div class="paragraph"><p>More precisely, <em>git pull</em> runs <em>git fetch</em> with the given
596 parameters and calls <em>git merge</em> to merge the retrieved branch
597 heads into the current branch.
598 With <tt>--rebase</tt>, it runs <em>git rebase</em> instead of <em>git merge</em>.</p></div>
599 <div class="paragraph"><p>&lt;repository&gt; should be the name of a remote repository as
600 passed to <a href="git-fetch.html">git-fetch(1)</a>. &lt;refspec&gt; can name an
601 arbitrary remote ref (for example, the name of a tag) or even
602 a collection of refs with corresponding remote-tracking branches
603 (e.g., refs/heads/&#42;:refs/remotes/origin/&#42;),
604 but usually it is the name of a branch in the remote repository.</p></div>
605 <div class="paragraph"><p>Default values for &lt;repository&gt; and &lt;branch&gt; are read from the
606 "remote" and "merge" configuration for the current branch
607 as set by <a href="git-branch.html">git-branch(1)</a> <tt>--track</tt>.</p></div>
608 <div class="paragraph"><p>Assume the following history exists and the current branch is
609 "<tt>master</tt>":</p></div>
610 <div class="listingblock">
611 <div class="content">
612 <pre><tt> A---B---C master on origin
614 D---E---F---G master</tt></pre>
615 </div></div>
616 <div class="paragraph"><p>Then "<tt>git pull</tt>" will fetch and replay the changes from the remote
617 <tt>master</tt> branch since it diverged from the local <tt>master</tt> (i.e., <tt>E</tt>)
618 until its current commit (<tt>C</tt>) on top of <tt>master</tt> and record the
619 result in a new commit along with the names of the two parent commits
620 and a log message from the user describing the changes.</p></div>
621 <div class="listingblock">
622 <div class="content">
623 <pre><tt> A---B---C remotes/origin/master
625 D---E---F---G---H master</tt></pre>
626 </div></div>
627 <div class="paragraph"><p>See <a href="git-merge.html">git-merge(1)</a> for details, including how conflicts
628 are presented and handled.</p></div>
629 <div class="paragraph"><p>In git 1.7.0 or later, to cancel a conflicting merge, use
630 <tt>git reset --merge</tt>. <strong>Warning</strong>: In older versions of git, running <em>git pull</em>
631 with uncommitted changes is discouraged: while possible, it leaves you
632 in a state that may be hard to back out of in the case of a conflict.</p></div>
633 <div class="paragraph"><p>If any of the remote changes overlap with local uncommitted changes,
634 the merge will be automatically cancelled and the work tree untouched.
635 It is generally best to get any local changes in working order before
636 pulling or stash them away with <a href="git-stash.html">git-stash(1)</a>.</p></div>
637 </div>
638 <h2 id="_options">OPTIONS</h2>
639 <div class="sectionbody">
640 <div class="paragraph"><p>Options meant for <em>git pull</em> itself and the underlying <em>git merge</em>
641 must be given before the options meant for <em>git fetch</em>.</p></div>
642 <div class="dlist"><dl>
643 <dt class="hdlist1">
645 </dt>
646 <dt class="hdlist1">
647 --quiet
648 </dt>
649 <dd>
651 This is passed to both underlying git-fetch to squelch reporting of
652 during transfer, and underlying git-merge to squelch output during
653 merging.
654 </p>
655 </dd>
656 <dt class="hdlist1">
658 </dt>
659 <dt class="hdlist1">
660 --verbose
661 </dt>
662 <dd>
664 Pass --verbose to git-fetch and git-merge.
665 </p>
666 </dd>
667 <dt class="hdlist1">
668 --[no-]recurse-submodules[=yes|on-demand|no]
669 </dt>
670 <dd>
672 This option controls if new commits of all populated submodules should
673 be fetched too (see <a href="git-config.html">git-config(1)</a> and <a href="gitmodules.html">gitmodules(5)</a>).
674 That might be necessary to get the data needed for merging submodule
675 commits, a feature git learned in 1.7.3. Notice that the result of a
676 merge will not be checked out in the submodule, "git submodule update"
677 has to be called afterwards to bring the work tree up to date with the
678 merge result.
679 </p>
680 </dd>
681 </dl></div>
682 <h3 id="_options_related_to_merging">Options related to merging</h3><div style="clear:left"></div>
683 <div class="dlist"><dl>
684 <dt class="hdlist1">
685 --commit
686 </dt>
687 <dt class="hdlist1">
688 --no-commit
689 </dt>
690 <dd>
692 Perform the merge and commit the result. This option can
693 be used to override --no-commit.
694 </p>
695 <div class="paragraph"><p>With --no-commit perform the merge but pretend the merge
696 failed and do not autocommit, to give the user a chance to
697 inspect and further tweak the merge result before committing.</p></div>
698 </dd>
699 <dt class="hdlist1">
700 --edit
701 </dt>
702 <dt class="hdlist1">
704 </dt>
705 <dd>
706 <div class="literalblock">
707 <div class="content">
708 <pre><tt>Invoke editor before committing successful merge to further
709 edit the default merge message.</tt></pre>
710 </div></div>
711 </dd>
712 <dt class="hdlist1">
713 --ff
714 </dt>
715 <dt class="hdlist1">
716 --no-ff
717 </dt>
718 <dd>
720 Do not generate a merge commit if the merge resolved as
721 a fast-forward, only update the branch pointer. This is
722 the default behavior of git-merge.
723 </p>
724 <div class="paragraph"><p>With --no-ff Generate a merge commit even if the merge
725 resolved as a fast-forward.</p></div>
726 </dd>
727 <dt class="hdlist1">
728 --log[=&lt;n&gt;]
729 </dt>
730 <dt class="hdlist1">
731 --no-log
732 </dt>
733 <dd>
735 In addition to branch names, populate the log message with
736 one-line descriptions from at most &lt;n&gt; actual commits that are being
737 merged. See also <a href="git-fmt-merge-msg.html">git-fmt-merge-msg(1)</a>.
738 </p>
739 <div class="paragraph"><p>With --no-log do not list one-line descriptions from the
740 actual commits being merged.</p></div>
741 </dd>
742 <dt class="hdlist1">
743 --stat
744 </dt>
745 <dt class="hdlist1">
747 </dt>
748 <dt class="hdlist1">
749 --no-stat
750 </dt>
751 <dd>
753 Show a diffstat at the end of the merge. The diffstat is also
754 controlled by the configuration option merge.stat.
755 </p>
756 <div class="paragraph"><p>With -n or --no-stat do not show a diffstat at the end of the
757 merge.</p></div>
758 </dd>
759 <dt class="hdlist1">
760 --squash
761 </dt>
762 <dt class="hdlist1">
763 --no-squash
764 </dt>
765 <dd>
767 Produce the working tree and index state as if a real
768 merge happened (except for the merge information),
769 but do not actually make a commit or
770 move the <tt>HEAD</tt>, nor record <tt>$GIT_DIR/MERGE_HEAD</tt> to
771 cause the next <tt>git commit</tt> command to create a merge
772 commit. This allows you to create a single commit on
773 top of the current branch whose effect is the same as
774 merging another branch (or more in case of an octopus).
775 </p>
776 <div class="paragraph"><p>With --no-squash perform the merge and commit the result. This
777 option can be used to override --squash.</p></div>
778 </dd>
779 <dt class="hdlist1">
780 --ff-only
781 </dt>
782 <dd>
784 Refuse to merge and exit with a non-zero status unless the
785 current <tt>HEAD</tt> is already up-to-date or the merge can be
786 resolved as a fast-forward.
787 </p>
788 </dd>
789 <dt class="hdlist1">
790 -s &lt;strategy&gt;
791 </dt>
792 <dt class="hdlist1">
793 --strategy=&lt;strategy&gt;
794 </dt>
795 <dd>
797 Use the given merge strategy; can be supplied more than
798 once to specify them in the order they should be tried.
799 If there is no <tt>-s</tt> option, a built-in list of strategies
800 is used instead (<em>git merge-recursive</em> when merging a single
801 head, <em>git merge-octopus</em> otherwise).
802 </p>
803 </dd>
804 <dt class="hdlist1">
805 -X &lt;option&gt;
806 </dt>
807 <dt class="hdlist1">
808 --strategy-option=&lt;option&gt;
809 </dt>
810 <dd>
812 Pass merge strategy specific option through to the merge
813 strategy.
814 </p>
815 </dd>
816 <dt class="hdlist1">
817 --summary
818 </dt>
819 <dt class="hdlist1">
820 --no-summary
821 </dt>
822 <dd>
824 Synonyms to --stat and --no-stat; these are deprecated and will be
825 removed in the future.
826 </p>
827 </dd>
828 <dt class="hdlist1">
830 </dt>
831 <dt class="hdlist1">
832 --quiet
833 </dt>
834 <dd>
836 Operate quietly. Implies --no-progress.
837 </p>
838 </dd>
839 <dt class="hdlist1">
841 </dt>
842 <dt class="hdlist1">
843 --verbose
844 </dt>
845 <dd>
847 Be verbose.
848 </p>
849 </dd>
850 <dt class="hdlist1">
851 --progress
852 </dt>
853 <dt class="hdlist1">
854 --no-progress
855 </dt>
856 <dd>
858 Turn progress on/off explicitly. If neither is specified,
859 progress is shown if standard error is connected to a terminal.
860 Note that not all merge strategies may support progress
861 reporting.
862 </p>
863 </dd>
864 </dl></div>
865 <div class="dlist"><dl>
866 <dt class="hdlist1">
867 --rebase
868 </dt>
869 <dd>
871 Rebase the current branch on top of the upstream branch after
872 fetching. If there is a remote-tracking branch corresponding to
873 the upstream branch and the upstream branch was rebased since last
874 fetched, the rebase uses that information to avoid rebasing
875 non-local changes.
876 </p>
877 <div class="paragraph"><p>See <tt>branch.&lt;name&gt;.rebase</tt> and <tt>branch.autosetuprebase</tt> in
878 <a href="git-config.html">git-config(1)</a> if you want to make <tt>git pull</tt> always use
879 <tt>&#45;&#45;rebase</tt> instead of merging.</p></div>
880 <div class="admonitionblock">
881 <table><tr>
882 <td class="icon">
883 <div class="title">Note</div>
884 </td>
885 <td class="content">This is a potentially <em>dangerous</em> mode of operation.
886 It rewrites history, which does not bode well when you
887 published that history already. Do <strong>not</strong> use this option
888 unless you have read <a href="git-rebase.html">git-rebase(1)</a> carefully.</td>
889 </tr></table>
890 </div>
891 </dd>
892 <dt class="hdlist1">
893 --no-rebase
894 </dt>
895 <dd>
897 Override earlier --rebase.
898 </p>
899 </dd>
900 </dl></div>
901 <h3 id="_options_related_to_fetching">Options related to fetching</h3><div style="clear:left"></div>
902 <div class="dlist"><dl>
903 <dt class="hdlist1">
904 --all
905 </dt>
906 <dd>
908 Fetch all remotes.
909 </p>
910 </dd>
911 <dt class="hdlist1">
913 </dt>
914 <dt class="hdlist1">
915 --append
916 </dt>
917 <dd>
919 Append ref names and object names of fetched refs to the
920 existing contents of <tt>.git/FETCH_HEAD</tt>. Without this
921 option old data in <tt>.git/FETCH_HEAD</tt> will be overwritten.
922 </p>
923 </dd>
924 <dt class="hdlist1">
925 --depth=&lt;depth&gt;
926 </dt>
927 <dd>
929 Deepen the history of a <em>shallow</em> repository created by
930 <tt>git clone</tt> with <tt>--depth=&lt;depth&gt;</tt> option (see <a href="git-clone.html">git-clone(1)</a>)
931 by the specified number of commits.
932 </p>
933 </dd>
934 <dt class="hdlist1">
936 </dt>
937 <dt class="hdlist1">
938 --force
939 </dt>
940 <dd>
942 When <em>git fetch</em> is used with <tt>&lt;rbranch&gt;:&lt;lbranch&gt;</tt>
943 refspec, it refuses to update the local branch
944 <tt>&lt;lbranch&gt;</tt> unless the remote branch <tt>&lt;rbranch&gt;</tt> it
945 fetches is a descendant of <tt>&lt;lbranch&gt;</tt>. This option
946 overrides that check.
947 </p>
948 </dd>
949 <dt class="hdlist1">
951 </dt>
952 <dt class="hdlist1">
953 --keep
954 </dt>
955 <dd>
957 Keep downloaded pack.
958 </p>
959 </dd>
960 <dt class="hdlist1">
961 --no-tags
962 </dt>
963 <dd>
965 By default, tags that point at objects that are downloaded
966 from the remote repository are fetched and stored locally.
967 This option disables this automatic tag following. The default
968 behavior for a remote may be specified with the remote.&lt;name&gt;.tagopt
969 setting. See <a href="git-config.html">git-config(1)</a>.
970 </p>
971 </dd>
972 <dt class="hdlist1">
974 </dt>
975 <dt class="hdlist1">
976 --update-head-ok
977 </dt>
978 <dd>
980 By default <em>git fetch</em> refuses to update the head which
981 corresponds to the current branch. This flag disables the
982 check. This is purely for the internal use for <em>git pull</em>
983 to communicate with <em>git fetch</em>, and unless you are
984 implementing your own Porcelain you are not supposed to
985 use it.
986 </p>
987 </dd>
988 <dt class="hdlist1">
989 --upload-pack &lt;upload-pack&gt;
990 </dt>
991 <dd>
993 When given, and the repository to fetch from is handled
994 by <em>git fetch-pack</em>, <em>--exec=&lt;upload-pack&gt;</em> is passed to
995 the command to specify non-default path for the command
996 run on the other end.
997 </p>
998 </dd>
999 <dt class="hdlist1">
1000 --progress
1001 </dt>
1002 <dd>
1004 Progress status is reported on the standard error stream
1005 by default when it is attached to a terminal, unless -q
1006 is specified. This flag forces progress status even if the
1007 standard error stream is not directed to a terminal.
1008 </p>
1009 </dd>
1010 <dt class="hdlist1">
1011 &lt;repository&gt;
1012 </dt>
1013 <dd>
1015 The "remote" repository that is the source of a fetch
1016 or pull operation. This parameter can be either a URL
1017 (see the section <a href="#URLS">GIT URLS</a> below) or the name
1018 of a remote (see the section <a href="#REMOTES">REMOTES</a> below).
1019 </p>
1020 </dd>
1021 <dt class="hdlist1">
1022 &lt;refspec&gt;
1023 </dt>
1024 <dd>
1026 The format of a &lt;refspec&gt; parameter is an optional plus
1027 <tt>&#43;</tt>, followed by the source ref &lt;src&gt;, followed
1028 by a colon <tt>:</tt>, followed by the destination ref &lt;dst&gt;.
1029 </p>
1030 <div class="paragraph"><p>The remote ref that matches &lt;src&gt;
1031 is fetched, and if &lt;dst&gt; is not empty string, the local
1032 ref that matches it is fast-forwarded using &lt;src&gt;.
1033 If the optional plus <tt>+</tt> is used, the local ref
1034 is updated even if it does not result in a fast-forward
1035 update.</p></div>
1036 <div class="admonitionblock">
1037 <table><tr>
1038 <td class="icon">
1039 <div class="title">Note</div>
1040 </td>
1041 <td class="content">If the remote branch from which you want to pull is
1042 modified in non-linear ways such as being rewound and
1043 rebased frequently, then a pull will attempt a merge with
1044 an older version of itself, likely conflict, and fail.
1045 It is under these conditions that you would want to use
1046 the <tt>+</tt> sign to indicate non-fast-forward updates will
1047 be needed. There is currently no easy way to determine
1048 or declare that a branch will be made available in a
1049 repository with this behavior; the pulling user simply
1050 must know this is the expected usage pattern for a branch.</td>
1051 </tr></table>
1052 </div>
1053 <div class="admonitionblock">
1054 <table><tr>
1055 <td class="icon">
1056 <div class="title">Note</div>
1057 </td>
1058 <td class="content">You never do your own development on branches that appear
1059 on the right hand side of a &lt;refspec&gt; colon on <tt>Pull:</tt> lines;
1060 they are to be updated by <em>git fetch</em>. If you intend to do
1061 development derived from a remote branch <tt>B</tt>, have a <tt>Pull:</tt>
1062 line to track it (i.e. <tt>Pull: B:remote-B</tt>), and have a separate
1063 branch <tt>my-B</tt> to do your development on top of it. The latter
1064 is created by <tt>git branch my-B remote-B</tt> (or its equivalent <tt>git
1065 checkout -b my-B remote-B</tt>). Run <tt>git fetch</tt> to keep track of
1066 the progress of the remote side, and when you see something new
1067 on the remote branch, merge it into your development branch with
1068 <tt>git pull . remote-B</tt>, while you are on <tt>my-B</tt> branch.</td>
1069 </tr></table>
1070 </div>
1071 <div class="admonitionblock">
1072 <table><tr>
1073 <td class="icon">
1074 <div class="title">Note</div>
1075 </td>
1076 <td class="content">There is a difference between listing multiple &lt;refspec&gt;
1077 directly on <em>git pull</em> command line and having multiple
1078 <tt>Pull:</tt> &lt;refspec&gt; lines for a &lt;repository&gt; and running
1079 <em>git pull</em> command without any explicit &lt;refspec&gt; parameters.
1080 &lt;refspec&gt; listed explicitly on the command line are always
1081 merged into the current branch after fetching. In other words,
1082 if you list more than one remote refs, you would be making
1083 an Octopus. While <em>git pull</em> run without any explicit &lt;refspec&gt;
1084 parameter takes default &lt;refspec&gt;s from <tt>Pull:</tt> lines, it
1085 merges only the first &lt;refspec&gt; found into the current branch,
1086 after fetching all the remote refs. This is because making an
1087 Octopus from remote refs is rarely done, while keeping track
1088 of multiple remote heads in one-go by fetching more than one
1089 is often useful.</td>
1090 </tr></table>
1091 </div>
1092 <div class="paragraph"><p>Some short-cut notations are also supported.</p></div>
1093 <div class="ulist"><ul>
1094 <li>
1096 <tt>tag &lt;tag&gt;</tt> means the same as <tt>refs/tags/&lt;tag&gt;:refs/tags/&lt;tag&gt;</tt>;
1097 it requests fetching everything up to the given tag.
1098 </p>
1099 </li>
1100 <li>
1102 A parameter &lt;ref&gt; without a colon is equivalent to
1103 &lt;ref&gt;: when pulling/fetching, so it merges &lt;ref&gt; into the current
1104 branch without storing the remote branch anywhere locally
1105 </p>
1106 </li>
1107 </ul></div>
1108 </dd>
1109 </dl></div>
1110 </div>
1111 <h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2>
1112 <div class="sectionbody">
1113 <div class="paragraph"><p>In general, URLs contain information about the transport protocol, the
1114 address of the remote server, and the path to the repository.
1115 Depending on the transport protocol, some of this information may be
1116 absent.</p></div>
1117 <div class="paragraph"><p>Git natively supports ssh, git, http, https, ftp, ftps, and rsync
1118 protocols. The following syntaxes may be used with them:</p></div>
1119 <div class="ulist"><ul>
1120 <li>
1122 ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
1123 </p>
1124 </li>
1125 <li>
1127 git://host.xz&#91;:port&#93;/path/to/repo.git/
1128 </p>
1129 </li>
1130 <li>
1132 http&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
1133 </p>
1134 </li>
1135 <li>
1137 ftp&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
1138 </p>
1139 </li>
1140 <li>
1142 rsync://host.xz/path/to/repo.git/
1143 </p>
1144 </li>
1145 </ul></div>
1146 <div class="paragraph"><p>An alternative scp-like syntax may also be used with the ssh protocol:</p></div>
1147 <div class="ulist"><ul>
1148 <li>
1150 &#91;user@&#93;host.xz:path/to/repo.git/
1151 </p>
1152 </li>
1153 </ul></div>
1154 <div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
1155 <div class="ulist"><ul>
1156 <li>
1158 ssh://&#91;user@&#93;host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1159 </p>
1160 </li>
1161 <li>
1163 git://host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1164 </p>
1165 </li>
1166 <li>
1168 &#91;user@&#93;host.xz:/~&#91;user&#93;/path/to/repo.git/
1169 </p>
1170 </li>
1171 </ul></div>
1172 <div class="paragraph"><p>For local repositories, also supported by git natively, the following
1173 syntaxes may be used:</p></div>
1174 <div class="ulist"><ul>
1175 <li>
1177 /path/to/repo.git/
1178 </p>
1179 </li>
1180 <li>
1182 <a href="file:///path/to/repo.git/">file:///path/to/repo.git/</a>
1183 </p>
1184 </li>
1185 </ul></div>
1186 <div class="paragraph"><p>These two syntaxes are mostly equivalent, except when cloning, when
1187 the former implies --local option. See <a href="git-clone.html">git-clone(1)</a> for
1188 details.</p></div>
1189 <div class="paragraph"><p>When git doesn&#8217;t know how to handle a certain transport protocol, it
1190 attempts to use the <em>remote-&lt;transport&gt;</em> remote helper, if one
1191 exists. To explicitly request a remote helper, the following syntax
1192 may be used:</p></div>
1193 <div class="ulist"><ul>
1194 <li>
1196 &lt;transport&gt;::&lt;address&gt;
1197 </p>
1198 </li>
1199 </ul></div>
1200 <div class="paragraph"><p>where &lt;address&gt; may be a path, a server and path, or an arbitrary
1201 URL-like string recognized by the specific remote helper being
1202 invoked. See <a href="git-remote-helpers.html">git-remote-helpers(1)</a> for details.</p></div>
1203 <div class="paragraph"><p>If there are a large number of similarly-named remote repositories and
1204 you want to use a different format for them (such that the URLs you
1205 use will be rewritten into URLs that work), you can create a
1206 configuration section of the form:</p></div>
1207 <div class="listingblock">
1208 <div class="content">
1209 <pre><tt> [url "&lt;actual url base&gt;"]
1210 insteadOf = &lt;other url base&gt;</tt></pre>
1211 </div></div>
1212 <div class="paragraph"><p>For example, with this:</p></div>
1213 <div class="listingblock">
1214 <div class="content">
1215 <pre><tt> [url "git://git.host.xz/"]
1216 insteadOf = host.xz:/path/to/
1217 insteadOf = work:</tt></pre>
1218 </div></div>
1219 <div class="paragraph"><p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
1220 rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
1221 <div class="paragraph"><p>If you want to rewrite URLs for push only, you can create a
1222 configuration section of the form:</p></div>
1223 <div class="listingblock">
1224 <div class="content">
1225 <pre><tt> [url "&lt;actual url base&gt;"]
1226 pushInsteadOf = &lt;other url base&gt;</tt></pre>
1227 </div></div>
1228 <div class="paragraph"><p>For example, with this:</p></div>
1229 <div class="listingblock">
1230 <div class="content">
1231 <pre><tt> [url "ssh://example.org/"]
1232 pushInsteadOf = git://example.org/</tt></pre>
1233 </div></div>
1234 <div class="paragraph"><p>a URL like "git://example.org/path/to/repo.git" will be rewritten to
1235 "ssh://example.org/path/to/repo.git" for pushes, but pulls will still
1236 use the original URL.</p></div>
1237 </div>
1238 <h2 id="_remotes_a_id_remotes_a">REMOTES<a id="REMOTES"></a></h2>
1239 <div class="sectionbody">
1240 <div class="paragraph"><p>The name of one of the following can be used instead
1241 of a URL as <tt>&lt;repository&gt;</tt> argument:</p></div>
1242 <div class="ulist"><ul>
1243 <li>
1245 a remote in the git configuration file: <tt>$GIT_DIR/config</tt>,
1246 </p>
1247 </li>
1248 <li>
1250 a file in the <tt>$GIT_DIR/remotes</tt> directory, or
1251 </p>
1252 </li>
1253 <li>
1255 a file in the <tt>$GIT_DIR/branches</tt> directory.
1256 </p>
1257 </li>
1258 </ul></div>
1259 <div class="paragraph"><p>All of these also allow you to omit the refspec from the command line
1260 because they each contain a refspec which git will use by default.</p></div>
1261 <h3 id="_named_remote_in_configuration_file">Named remote in configuration file</h3><div style="clear:left"></div>
1262 <div class="paragraph"><p>You can choose to provide the name of a remote which you had previously
1263 configured using <a href="git-remote.html">git-remote(1)</a>, <a href="git-config.html">git-config(1)</a>
1264 or even by a manual edit to the <tt>$GIT_DIR/config</tt> file. The URL of
1265 this remote will be used to access the repository. The refspec
1266 of this remote will be used by default when you do
1267 not provide a refspec on the command line. The entry in the
1268 config file would appear like this:</p></div>
1269 <div class="listingblock">
1270 <div class="content">
1271 <pre><tt> [remote "&lt;name&gt;"]
1272 url = &lt;url&gt;
1273 pushurl = &lt;pushurl&gt;
1274 push = &lt;refspec&gt;
1275 fetch = &lt;refspec&gt;</tt></pre>
1276 </div></div>
1277 <div class="paragraph"><p>The <tt>&lt;pushurl&gt;</tt> is used for pushes only. It is optional and defaults
1278 to <tt>&lt;url&gt;</tt>.</p></div>
1279 <h3 id="_named_file_in_tt_git_dir_remotes_tt">Named file in <tt>$GIT_DIR/remotes</tt></h3><div style="clear:left"></div>
1280 <div class="paragraph"><p>You can choose to provide the name of a
1281 file in <tt>$GIT_DIR/remotes</tt>. The URL
1282 in this file will be used to access the repository. The refspec
1283 in this file will be used as default when you do not
1284 provide a refspec on the command line. This file should have the
1285 following format:</p></div>
1286 <div class="listingblock">
1287 <div class="content">
1288 <pre><tt> URL: one of the above URL format
1289 Push: &lt;refspec&gt;
1290 Pull: &lt;refspec&gt;</tt></pre>
1291 </div></div>
1292 <div class="paragraph"><p><tt>Push:</tt> lines are used by <em>git push</em> and
1293 <tt>Pull:</tt> lines are used by <em>git pull</em> and <em>git fetch</em>.
1294 Multiple <tt>Push:</tt> and <tt>Pull:</tt> lines may
1295 be specified for additional branch mappings.</p></div>
1296 <h3 id="_named_file_in_tt_git_dir_branches_tt">Named file in <tt>$GIT_DIR/branches</tt></h3><div style="clear:left"></div>
1297 <div class="paragraph"><p>You can choose to provide the name of a
1298 file in <tt>$GIT_DIR/branches</tt>.
1299 The URL in this file will be used to access the repository.
1300 This file should have the following format:</p></div>
1301 <div class="listingblock">
1302 <div class="content">
1303 <pre><tt> &lt;url&gt;#&lt;head&gt;</tt></pre>
1304 </div></div>
1305 <div class="paragraph"><p><tt>&lt;url&gt;</tt> is required; <tt>#&lt;head&gt;</tt> is optional.</p></div>
1306 <div class="paragraph"><p>Depending on the operation, git will use one of the following
1307 refspecs, if you don&#8217;t provide one on the command line.
1308 <tt>&lt;branch&gt;</tt> is the name of this file in <tt>$GIT_DIR/branches</tt> and
1309 <tt>&lt;head&gt;</tt> defaults to <tt>master</tt>.</p></div>
1310 <div class="paragraph"><p>git fetch uses:</p></div>
1311 <div class="listingblock">
1312 <div class="content">
1313 <pre><tt> refs/heads/&lt;head&gt;:refs/heads/&lt;branch&gt;</tt></pre>
1314 </div></div>
1315 <div class="paragraph"><p>git push uses:</p></div>
1316 <div class="listingblock">
1317 <div class="content">
1318 <pre><tt> HEAD:refs/heads/&lt;head&gt;</tt></pre>
1319 </div></div>
1320 </div>
1321 <h2 id="_merge_strategies">MERGE STRATEGIES</h2>
1322 <div class="sectionbody">
1323 <div class="paragraph"><p>The merge mechanism (<em>git-merge</em> and <em>git-pull</em> commands) allows the
1324 backend <em>merge strategies</em> to be chosen with <tt>-s</tt> option. Some strategies
1325 can also take their own options, which can be passed by giving <tt>-X&lt;option&gt;</tt>
1326 arguments to <em>git-merge</em> and/or <em>git-pull</em>.</p></div>
1327 <div class="dlist"><dl>
1328 <dt class="hdlist1">
1329 resolve
1330 </dt>
1331 <dd>
1333 This can only resolve two heads (i.e. the current branch
1334 and another branch you pulled from) using a 3-way merge
1335 algorithm. It tries to carefully detect criss-cross
1336 merge ambiguities and is considered generally safe and
1337 fast.
1338 </p>
1339 </dd>
1340 <dt class="hdlist1">
1341 recursive
1342 </dt>
1343 <dd>
1345 This can only resolve two heads using a 3-way merge
1346 algorithm. When there is more than one common
1347 ancestor that can be used for 3-way merge, it creates a
1348 merged tree of the common ancestors and uses that as
1349 the reference tree for the 3-way merge. This has been
1350 reported to result in fewer merge conflicts without
1351 causing mis-merges by tests done on actual merge commits
1352 taken from Linux 2.6 kernel development history.
1353 Additionally this can detect and handle merges involving
1354 renames. This is the default merge strategy when
1355 pulling or merging one branch.
1356 </p>
1357 <div class="paragraph"><p>The <em>recursive</em> strategy can take the following options:</p></div>
1358 <div class="dlist"><dl>
1359 <dt class="hdlist1">
1360 ours
1361 </dt>
1362 <dd>
1364 This option forces conflicting hunks to be auto-resolved cleanly by
1365 favoring <em>our</em> version. Changes from the other tree that do not
1366 conflict with our side are reflected to the merge result.
1367 </p>
1368 <div class="paragraph"><p>This should not be confused with the <em>ours</em> merge strategy, which does not
1369 even look at what the other tree contains at all. It discards everything
1370 the other tree did, declaring <em>our</em> history contains all that happened in it.</p></div>
1371 </dd>
1372 <dt class="hdlist1">
1373 theirs
1374 </dt>
1375 <dd>
1377 This is opposite of <em>ours</em>.
1378 </p>
1379 </dd>
1380 <dt class="hdlist1">
1381 patience
1382 </dt>
1383 <dd>
1385 With this option, <em>merge-recursive</em> spends a little extra time
1386 to avoid mismerges that sometimes occur due to unimportant
1387 matching lines (e.g., braces from distinct functions). Use
1388 this when the branches to be merged have diverged wildly.
1389 See also <a href="git-diff.html">git-diff(1)</a> <tt>--patience</tt>.
1390 </p>
1391 </dd>
1392 <dt class="hdlist1">
1393 ignore-space-change
1394 </dt>
1395 <dt class="hdlist1">
1396 ignore-all-space
1397 </dt>
1398 <dt class="hdlist1">
1399 ignore-space-at-eol
1400 </dt>
1401 <dd>
1403 Treats lines with the indicated type of whitespace change as
1404 unchanged for the sake of a three-way merge. Whitespace
1405 changes mixed with other changes to a line are not ignored.
1406 See also <a href="git-diff.html">git-diff(1)</a> <tt>-b</tt>, <tt>-w</tt>, and
1407 <tt>--ignore-space-at-eol</tt>.
1408 </p>
1409 <div class="ulist"><ul>
1410 <li>
1412 If <em>their</em> version only introduces whitespace changes to a line,
1413 <em>our</em> version is used;
1414 </p>
1415 </li>
1416 <li>
1418 If <em>our</em> version introduces whitespace changes but <em>their</em>
1419 version includes a substantial change, <em>their</em> version is used;
1420 </p>
1421 </li>
1422 <li>
1424 Otherwise, the merge proceeds in the usual way.
1425 </p>
1426 </li>
1427 </ul></div>
1428 </dd>
1429 <dt class="hdlist1">
1430 renormalize
1431 </dt>
1432 <dd>
1434 This runs a virtual check-out and check-in of all three stages
1435 of a file when resolving a three-way merge. This option is
1436 meant to be used when merging branches with different clean
1437 filters or end-of-line normalization rules. See "Merging
1438 branches with differing checkin/checkout attributes" in
1439 <a href="gitattributes.html">gitattributes(5)</a> for details.
1440 </p>
1441 </dd>
1442 <dt class="hdlist1">
1443 no-renormalize
1444 </dt>
1445 <dd>
1447 Disables the <tt>renormalize</tt> option. This overrides the
1448 <tt>merge.renormalize</tt> configuration variable.
1449 </p>
1450 </dd>
1451 <dt class="hdlist1">
1452 rename-threshold=&lt;n&gt;
1453 </dt>
1454 <dd>
1456 Controls the similarity threshold used for rename detection.
1457 See also <a href="git-diff.html">git-diff(1)</a> <tt>-M</tt>.
1458 </p>
1459 </dd>
1460 <dt class="hdlist1">
1461 subtree[=&lt;path&gt;]
1462 </dt>
1463 <dd>
1465 This option is a more advanced form of <em>subtree</em> strategy, where
1466 the strategy makes a guess on how two trees must be shifted to
1467 match with each other when merging. Instead, the specified path
1468 is prefixed (or stripped from the beginning) to make the shape of
1469 two trees to match.
1470 </p>
1471 </dd>
1472 </dl></div>
1473 </dd>
1474 <dt class="hdlist1">
1475 octopus
1476 </dt>
1477 <dd>
1479 This resolves cases with more than two heads, but refuses to do
1480 a complex merge that needs manual resolution. It is
1481 primarily meant to be used for bundling topic branch
1482 heads together. This is the default merge strategy when
1483 pulling or merging more than one branch.
1484 </p>
1485 </dd>
1486 <dt class="hdlist1">
1487 ours
1488 </dt>
1489 <dd>
1491 This resolves any number of heads, but the resulting tree of the
1492 merge is always that of the current branch head, effectively
1493 ignoring all changes from all other branches. It is meant to
1494 be used to supersede old development history of side
1495 branches. Note that this is different from the -Xours option to
1496 the <em>recursive</em> merge strategy.
1497 </p>
1498 </dd>
1499 <dt class="hdlist1">
1500 subtree
1501 </dt>
1502 <dd>
1504 This is a modified recursive strategy. When merging trees A and
1505 B, if B corresponds to a subtree of A, B is first adjusted to
1506 match the tree structure of A, instead of reading the trees at
1507 the same level. This adjustment is also done to the common
1508 ancestor tree.
1509 </p>
1510 </dd>
1511 </dl></div>
1512 </div>
1513 <h2 id="_default_behaviour">DEFAULT BEHAVIOUR</h2>
1514 <div class="sectionbody">
1515 <div class="paragraph"><p>Often people use <tt>git pull</tt> without giving any parameter.
1516 Traditionally, this has been equivalent to saying <tt>git pull
1517 origin</tt>. However, when configuration <tt>branch.&lt;name&gt;.remote</tt> is
1518 present while on branch <tt>&lt;name&gt;</tt>, that value is used instead of
1519 <tt>origin</tt>.</p></div>
1520 <div class="paragraph"><p>In order to determine what URL to use to fetch from, the value
1521 of the configuration <tt>remote.&lt;origin&gt;.url</tt> is consulted
1522 and if there is not any such variable, the value on <tt>URL: ` line
1523 in `$GIT_DIR/remotes/&lt;origin&gt;</tt> file is used.</p></div>
1524 <div class="paragraph"><p>In order to determine what remote branches to fetch (and
1525 optionally store in the remote-tracking branches) when the command is
1526 run without any refspec parameters on the command line, values
1527 of the configuration variable <tt>remote.&lt;origin&gt;.fetch</tt> are
1528 consulted, and if there aren&#8217;t any, <tt>$GIT_DIR/remotes/&lt;origin&gt;</tt>
1529 file is consulted and its `Pull: ` lines are used.
1530 In addition to the refspec formats described in the OPTIONS
1531 section, you can have a globbing refspec that looks like this:</p></div>
1532 <div class="listingblock">
1533 <div class="content">
1534 <pre><tt>refs/heads/*:refs/remotes/origin/*</tt></pre>
1535 </div></div>
1536 <div class="paragraph"><p>A globbing refspec must have a non-empty RHS (i.e. must store
1537 what were fetched in remote-tracking branches), and its LHS and RHS
1538 must end with <tt>/*</tt>. The above specifies that all remote
1539 branches are tracked using remote-tracking branches in
1540 <tt>refs/remotes/origin/</tt> hierarchy under the same name.</p></div>
1541 <div class="paragraph"><p>The rule to determine which remote branch to merge after
1542 fetching is a bit involved, in order not to break backward
1543 compatibility.</p></div>
1544 <div class="paragraph"><p>If explicit refspecs were given on the command
1545 line of <tt>git pull</tt>, they are all merged.</p></div>
1546 <div class="paragraph"><p>When no refspec was given on the command line, then <tt>git pull</tt>
1547 uses the refspec from the configuration or
1548 <tt>$GIT_DIR/remotes/&lt;origin&gt;</tt>. In such cases, the following
1549 rules apply:</p></div>
1550 <div class="olist arabic"><ol class="arabic">
1551 <li>
1553 If <tt>branch.&lt;name&gt;.merge</tt> configuration for the current
1554 branch <tt>&lt;name&gt;</tt> exists, that is the name of the branch at the
1555 remote site that is merged.
1556 </p>
1557 </li>
1558 <li>
1560 If the refspec is a globbing one, nothing is merged.
1561 </p>
1562 </li>
1563 <li>
1565 Otherwise the remote branch of the first refspec is merged.
1566 </p>
1567 </li>
1568 </ol></div>
1569 </div>
1570 <h2 id="_examples">EXAMPLES</h2>
1571 <div class="sectionbody">
1572 <div class="ulist"><ul>
1573 <li>
1575 Update the remote-tracking branches for the repository
1576 you cloned from, then merge one of them into your
1577 current branch:
1578 </p>
1579 <div class="listingblock">
1580 <div class="content">
1581 <pre><tt>$ git pull, git pull origin</tt></pre>
1582 </div></div>
1583 <div class="paragraph"><p>Normally the branch merged in is the HEAD of the remote repository,
1584 but the choice is determined by the branch.&lt;name&gt;.remote and
1585 branch.&lt;name&gt;.merge options; see <a href="git-config.html">git-config(1)</a> for details.</p></div>
1586 </li>
1587 <li>
1589 Merge into the current branch the remote branch <tt>next</tt>:
1590 </p>
1591 <div class="listingblock">
1592 <div class="content">
1593 <pre><tt>$ git pull origin next</tt></pre>
1594 </div></div>
1595 <div class="paragraph"><p>This leaves a copy of <tt>next</tt> temporarily in FETCH_HEAD, but
1596 does not update any remote-tracking branches. Using remote-tracking
1597 branches, the same can be done by invoking fetch and merge:</p></div>
1598 <div class="listingblock">
1599 <div class="content">
1600 <pre><tt>$ git fetch origin
1601 $ git merge origin/next</tt></pre>
1602 </div></div>
1603 </li>
1604 </ul></div>
1605 <div class="paragraph"><p>If you tried a pull which resulted in a complex conflicts and
1606 would want to start over, you can recover with <em>git reset</em>.</p></div>
1607 </div>
1608 <h2 id="_bugs">BUGS</h2>
1609 <div class="sectionbody">
1610 <div class="paragraph"><p>Using --recurse-submodules can only fetch new commits in already checked
1611 out submodules right now. When e.g. upstream added a new submodule in the
1612 just fetched commits of the superproject the submodule itself can not be
1613 fetched, making it impossible to check out that submodule later without
1614 having to do a fetch again. This is expected to be fixed in a future git
1615 version.</p></div>
1616 </div>
1617 <h2 id="_see_also">SEE ALSO</h2>
1618 <div class="sectionbody">
1619 <div class="paragraph"><p><a href="git-fetch.html">git-fetch(1)</a>, <a href="git-merge.html">git-merge(1)</a>, <a href="git-config.html">git-config(1)</a></p></div>
1620 </div>
1621 <h2 id="_git">GIT</h2>
1622 <div class="sectionbody">
1623 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1624 </div>
1625 </div>
1626 <div id="footnotes"><hr /></div>
1627 <div id="footer">
1628 <div id="footer-text">
1629 Last updated 2011-09-21 23:01:14 PDT
1630 </div>
1631 </div>
1632 </body>
1633 </html>