blob: 2ed02b37c9108c1bdcece954bd98f07da1e605b4 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamano7bd050f2011-09-22 06:32:226<meta name="generator" content="AsciiDoc 8.5.2" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-pull(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
9/* Debug borders */
10p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11/*
12 border: 1px solid red;
13*/
14}
15
16body {
17 margin: 1em 5% 1em 5%;
18}
19
Junio C Hamanoba4b9282008-07-06 05:20:3120a {
21 color: blue;
22 text-decoration: underline;
23}
24a:visited {
25 color: fuchsia;
26}
Junio C Hamano1a4e8412005-12-27 08:17:2327
28em {
29 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5930 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2331}
32
33strong {
34 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5935 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2336}
37
38tt {
39 color: navy;
40}
41
42h1, 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;
48}
49
Junio C Hamanoba4b9282008-07-06 05:20:3150h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 border-bottom: 2px solid silver;
52}
53h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2354 padding-top: 0.5em;
55}
Junio C Hamanoba4b9282008-07-06 05:20:3156h3 {
57 float: left;
58}
59h3 + * {
60 clear: left;
61}
Junio C Hamano1a4e8412005-12-27 08:17:2362
63div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
66}
67
68hr {
69 border: 1px solid silver;
70}
71
72p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
75}
76
Junio C Hamano68cf15a2010-11-06 01:01:5977ul, ol, li > p {
78 margin-top: 0;
79}
80
Junio C Hamano1a4e8412005-12-27 08:17:2381pre {
82 padding: 0;
83 margin: 0;
84}
85
86span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3190 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2391}
92span#email {
93}
Junio C Hamano68cf15a2010-11-06 01:01:5994span#revnumber, span#revdate, span#revremark {
Junio C Hamano1a4e8412005-12-27 08:17:2395 font-family: sans-serif;
96}
97
98div#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;
104}
105div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
108}
109div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
112}
113
Junio C Hamano68cf15a2010-11-06 01:01:59114div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
117}
Junio C Hamano1a4e8412005-12-27 08:17:23118div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22121 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23122 margin-bottom: 1.5em;
123}
124div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23129}
130
131div.content { /* Block element content. */
132 padding: 0;
133}
134
135/* Block element titles. */
136div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59137 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
143}
144div.title + * {
145 margin-top: 0;
146}
147
148td div.title:first-child {
149 margin-top: 0.0em;
150}
151div.content div.title:first-child {
152 margin-top: 0.0em;
153}
154div.content + div.title {
155 margin-top: 0.0em;
156}
157
158div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
162}
163
164div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
168}
169
Junio C Hamano7bd050f2011-09-22 06:32:22170div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59173 margin-right: 10%;
Junio C Hamano7bd050f2011-09-22 06:32:22174 border-left: 5px solid #dddddd;
175 color: #777777;
Junio C Hamano1a4e8412005-12-27 08:17:23176}
Junio C Hamano7bd050f2011-09-22 06:32:22177
Junio C Hamano68cf15a2010-11-06 01:01:59178div.quoteblock > div.attribution {
179 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23180 text-align: right;
181}
Junio C Hamano68cf15a2010-11-06 01:01:59182
Junio C Hamano68cf15a2010-11-06 01:01:59183div.verseblock > div.content {
184 white-space: pre;
185}
186div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
189}
190/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31191div.verseblock + div.attribution {
192 text-align: left;
193}
Junio C Hamano1a4e8412005-12-27 08:17:23194
195div.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;
202}
203div.admonitionblock td.content {
204 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22205 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23206}
207
208div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23211}
212
Junio C Hamano1a4e8412005-12-27 08:17:23213div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23214span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59215a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23216
217dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
220}
221dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59224 font-style: normal;
225 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23226}
227dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59228 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23229}
230
231ul, ol {
232 list-style-position: outside;
233}
Junio C Hamano68cf15a2010-11-06 01:01:59234ol.arabic {
235 list-style-type: decimal;
236}
237ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23238 list-style-type: lower-alpha;
239}
Junio C Hamano68cf15a2010-11-06 01:01:59240ol.upperalpha {
241 list-style-type: upper-alpha;
242}
243ol.lowerroman {
244 list-style-type: lower-roman;
245}
246ol.upperroman {
247 list-style-type: upper-roman;
248}
249
250div.compact ul, div.compact ol,
251div.compact p, div.compact p,
252div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
255}
Junio C Hamano1a4e8412005-12-27 08:17:23256
257div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31258 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23259}
Junio C Hamano7bd050f2011-09-22 06:32:22260thead, p.table.header {
Junio C Hamano1a4e8412005-12-27 08:17:23261 font-family: sans-serif;
262 font-weight: bold;
263}
264tfoot {
265 font-weight: bold;
266}
Junio C Hamano68cf15a2010-11-06 01:01:59267td > div.verse {
268 white-space: pre;
269}
270p.table {
271 margin-top: 0;
272}
273/* Because the table frame attribute is overriden by CSS in most browsers. */
274div.tableblock > table[frame="void"] {
275 border-style: none;
276}
277div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
280}
281div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
284}
Junio C Hamano1a4e8412005-12-27 08:17:23285
Junio C Hamano68cf15a2010-11-06 01:01:59286
287div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
290}
Junio C Hamano68cf15a2010-11-06 01:01:59291div.hdlist tr {
292 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31293}
Junio C Hamano68cf15a2010-11-06 01:01:59294dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
296}
297td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23298 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59299 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23300 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59301 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23302}
Junio C Hamano68cf15a2010-11-06 01:01:59303td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23304 vertical-align: top;
305}
Junio C Hamano68cf15a2010-11-06 01:01:59306div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
309}
310
311.comment {
312 background: yellow;
313}
Junio C Hamano1a4e8412005-12-27 08:17:23314
Junio C Hamano7bd050f2011-09-22 06:32:22315.footnote, .footnoteref {
316 font-size: 0.8em;
317}
318
319span.footnote, span.footnoteref {
320 vertical-align: super;
321}
322
323#footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
326}
327
328#footnotes div.footnote {
329 margin: 0 0 5px 0;
330}
331
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;
340}
341
342
Junio C Hamano1a4e8412005-12-27 08:17:23343@media print {
344 div#footer-badges { display: none; }
345}
Junio C Hamanoba4b9282008-07-06 05:20:31346
Junio C Hamano7bd050f2011-09-22 06:32:22347div#toc {
348 margin-bottom: 2.5em;
349}
350
Junio C Hamanoba4b9282008-07-06 05:20:31351div#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;
358}
359
360div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
363}
364div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
367}
368div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
371}
372div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
375}
Junio C Hamano68cf15a2010-11-06 01:01:59376/* Overrides for manpage documents */
377h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
382}
383h2 {
384 border-style: none;
385}
386div.sectionbody {
387 margin-left: 5%;
388}
389
390@media print {
391 div#toc { display: none; }
392}
393
Junio C Hamano1a4e8412005-12-27 08:17:23394/* Workarounds for IE6's broken and incomplete CSS2. */
395
396div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
400}
401div.sidebar-title, div.image-title {
Junio C Hamano68cf15a2010-11-06 01:01:59402 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
407}
408
409div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
413}
414
Junio C Hamano68cf15a2010-11-06 01:01:59415div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
418}
419
420div.verseblock-content {
421 white-space: pre;
422}
423div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
Junio C Hamano1a4e8412005-12-27 08:17:23426}
427
428div.exampleblock-content {
Junio C Hamano7bd050f2011-09-22 06:32:22429 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23430 padding-left: 0.5em;
431}
Junio C Hamanoba4b9282008-07-06 05:20:31432
433/* IE6 sets dynamically generated links as visited. */
434div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23435</style>
Junio C Hamano7bd050f2011-09-22 06:32:22436<script type="text/javascript">
437/*<![CDATA[*/
438window.onload = function(){asciidoc.footnotes();}
439var asciidoc = { // Namespace.
440
441/////////////////////////////////////////////////////////////////////
442// Table Of Contents generator
443/////////////////////////////////////////////////////////////////////
444
445/* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
447 *
448 * Table Of Content generator
449 * Version: 0.4
450 *
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.
453 */
454
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
457
458// toclevels = 1..4.
459toc: function (toclevels) {
460
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);
468 }
469 return text;
470 }
471
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
476 }
477
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);
490 }
491 iterate(i);
492 }
493 }
494 }
495 iterate(el);
496 return result;
497 }
498
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);
512 }
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
515},
516
517
518/////////////////////////////////////////////////////////////////////
519// Footnotes generator
520/////////////////////////////////////////////////////////////////////
521
522/* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
524 */
525
526footnotes: 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;
547 }
548 }
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>]";
561 }
562 }
563 }
564}
565
566}
567/*]]>*/
568</script>
Junio C Hamano1a4e8412005-12-27 08:17:23569</head>
570<body>
571<div id="header">
572<h1>
573git-pull(1) Manual Page
574</h1>
575<h2>NAME</h2>
576<div class="sectionbody">
577<p>git-pull -
Junio C Hamano7c73c662007-01-19 00:37:50578 Fetch from and merge with another repository or a local branch
Junio C Hamano1a4e8412005-12-27 08:17:23579</p>
580</div>
581</div>
Junio C Hamano7bd050f2011-09-22 06:32:22582<div id="content">
Junio C Hamano68cf15a2010-11-06 01:01:59583<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23584<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59585<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>
Junio C Hamano1a4e8412005-12-27 08:17:23589</div>
Junio C Hamanoba4b9282008-07-06 05:20:31590<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23591<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59592<div class="paragraph"><p>Incorporates changes from a remote repository into the current
Junio C Hamanob5a296f2010-08-13 02:46:36593branch. 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>
Junio C Hamano68cf15a2010-11-06 01:01:59595<div class="paragraph"><p>More precisely, <em>git pull</em> runs <em>git fetch</em> with the given
Junio C Hamanob5a296f2010-08-13 02:46:36596parameters and calls <em>git merge</em> to merge the retrieved branch
597heads into the current branch.
598With <tt>--rebase</tt>, it runs <em>git rebase</em> instead of <em>git merge</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59599<div class="paragraph"><p>&lt;repository&gt; should be the name of a remote repository as
Junio C Hamanoa28a9202012-06-21 07:08:23600passed to <a href="git-fetch.html">git-fetch(1)</a>. &lt;refspec&gt; can name an
Junio C Hamanob5a296f2010-08-13 02:46:36601arbitrary remote ref (for example, the name of a tag) or even
Junio C Hamano97bcb482010-11-25 03:16:07602a collection of refs with corresponding remote-tracking branches
Junio C Hamano2e6ded82010-12-05 06:20:48603(e.g., refs/heads/&#42;:refs/remotes/origin/&#42;),
604but usually it is the name of a branch in the remote repository.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59605<div class="paragraph"><p>Default values for &lt;repository&gt; and &lt;branch&gt; are read from the
Junio C Hamanob5a296f2010-08-13 02:46:36606"remote" and "merge" configuration for the current branch
Junio C Hamanoa28a9202012-06-21 07:08:23607as set by <a href="git-branch.html">git-branch(1)</a> <tt>--track</tt>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59608<div class="paragraph"><p>Assume the following history exists and the current branch is
Junio C Hamanob5a296f2010-08-13 02:46:36609"<tt>master</tt>":</p></div>
610<div class="listingblock">
611<div class="content">
612<pre><tt> A---B---C master on origin
613 /
614 D---E---F---G master</tt></pre>
615</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:59616<div class="paragraph"><p>Then "<tt>git pull</tt>" will fetch and replay the changes from the remote
Junio C Hamanob5a296f2010-08-13 02:46:36617<tt>master</tt> branch since it diverged from the local <tt>master</tt> (i.e., <tt>E</tt>)
618until its current commit (<tt>C</tt>) on top of <tt>master</tt> and record the
619result in a new commit along with the names of the two parent commits
620and 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
624 / \
625 D---E---F---G---H master</tt></pre>
626</div></div>
Junio C Hamanoa28a9202012-06-21 07:08:23627<div class="paragraph"><p>See <a href="git-merge.html">git-merge(1)</a> for details, including how conflicts
Junio C Hamanob5a296f2010-08-13 02:46:36628are presented and handled.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59629<div class="paragraph"><p>In git 1.7.0 or later, to cancel a conflicting merge, use
Junio C Hamanob5a296f2010-08-13 02:46:36630<tt>git reset --merge</tt>. <strong>Warning</strong>: In older versions of git, running <em>git pull</em>
Junio C Hamano1aa40d22010-01-21 17:46:43631with uncommitted changes is discouraged: while possible, it leaves you
Junio C Hamanob5a296f2010-08-13 02:46:36632in a state that may be hard to back out of in the case of a conflict.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59633<div class="paragraph"><p>If any of the remote changes overlap with local uncommitted changes,
Junio C Hamanob5a296f2010-08-13 02:46:36634the merge will be automatically cancelled and the work tree untouched.
635It is generally best to get any local changes in working order before
Junio C Hamanoa28a9202012-06-21 07:08:23636pulling or stash them away with <a href="git-stash.html">git-stash(1)</a>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23637</div>
Junio C Hamanoba4b9282008-07-06 05:20:31638<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23639<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59640<div class="paragraph"><p>Options meant for <em>git pull</em> itself and the underlying <em>git merge</em>
Junio C Hamanob5a296f2010-08-13 02:46:36641must be given before the options meant for <em>git fetch</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59642<div class="dlist"><dl>
643<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55644-q
645</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59646<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55647--quiet
648</dt>
649<dd>
650<p>
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>
Junio C Hamano68cf15a2010-11-06 01:01:59656<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55657-v
658</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59659<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55660--verbose
661</dt>
662<dd>
663<p>
664 Pass --verbose to git-fetch and git-merge.
665</p>
666</dd>
Junio C Hamanoe6116832011-02-08 00:49:45667<dt class="hdlist1">
Junio C Hamano5cd15182011-04-05 00:21:10668--[no-]recurse-submodules[=yes|on-demand|no]
Junio C Hamanoe6116832011-02-08 00:49:45669</dt>
670<dd>
671<p>
672 This option controls if new commits of all populated submodules should
Junio C Hamanoa28a9202012-06-21 07:08:23673 be fetched too (see <a href="git-config.html">git-config(1)</a> and <a href="gitmodules.html">gitmodules(5)</a>).
Junio C Hamanoe6116832011-02-08 00:49:45674 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>
Junio C Hamanoea90ab32010-03-15 20:32:55681</dl></div>
Junio C Hamanoc21ab052009-10-31 04:03:55682<h3 id="_options_related_to_merging">Options related to merging</h3><div style="clear:left"></div>
Junio C Hamano68cf15a2010-11-06 01:01:59683<div class="dlist"><dl>
684<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55685--commit
686</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59687<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55688--no-commit
689</dt>
690<dd>
691<p>
692 Perform the merge and commit the result. This option can
693 be used to override --no-commit.
694</p>
Junio C Hamano68cf15a2010-11-06 01:01:59695<div class="paragraph"><p>With --no-commit perform the merge but pretend the merge
Junio C Hamanoc21ab052009-10-31 04:03:55696failed and do not autocommit, to give the user a chance to
697inspect and further tweak the merge result before committing.</p></div>
698</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59699<dt class="hdlist1">
Junio C Hamano11821ed2011-10-19 18:42:09700--edit
701</dt>
702<dt class="hdlist1">
Junio C Hamano795a5a32012-02-02 01:36:37703--no-edit
Junio C Hamano11821ed2011-10-19 18:42:09704</dt>
705<dd>
Junio C Hamano92887a32011-12-07 00:26:29706<p>
Junio C Hamano795a5a32012-02-02 01:36:37707 Invoke an editor before committing successful mechanical merge to
708 further edit the auto-generated merge message, so that the user
709 can explain and justify the merge. The <tt>--no-edit</tt> option can be
710 used to accept the auto-generated message (this is generally
711 discouraged). The <tt>--edit</tt> option is still useful if you are
712 giving a draft message with the <tt>-m</tt> option from the command line
713 and want to edit it in the editor.
Junio C Hamano92887a32011-12-07 00:26:29714</p>
Junio C Hamano795a5a32012-02-02 01:36:37715<div class="paragraph"><p>Older scripts may depend on the historical behaviour of not allowing the
716user to edit the merge log message. They will see an editor opened when
717they run <tt>git merge</tt>. To make it easier to adjust such scripts to the
718updated behaviour, the environment variable <tt>GIT_MERGE_AUTOEDIT</tt> can be
719set to <tt>no</tt> at the beginning of them.</p></div>
Junio C Hamano11821ed2011-10-19 18:42:09720</dd>
721<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55722--ff
723</dt>
Junio C Hamanof54f08e2012-02-27 07:49:19724<dd>
725<p>
726 When the merge resolves as a fast-forward, only update the branch
727 pointer, without creating a merge commit. This is the default
728 behavior.
729</p>
730</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59731<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55732--no-ff
733</dt>
734<dd>
735<p>
Junio C Hamanof54f08e2012-02-27 07:49:19736 Create a merge commit even when the merge resolves as a
737 fast-forward.
Junio C Hamanoc21ab052009-10-31 04:03:55738</p>
Junio C Hamanof54f08e2012-02-27 07:49:19739</dd>
740<dt class="hdlist1">
741--ff-only
742</dt>
743<dd>
744<p>
745 Refuse to merge and exit with a non-zero status unless the
746 current <tt>HEAD</tt> is already up-to-date or the merge can be
747 resolved as a fast-forward.
748</p>
Junio C Hamanoc21ab052009-10-31 04:03:55749</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59750<dt class="hdlist1">
Junio C Hamano3b4609d2010-09-30 00:04:34751--log[=&lt;n&gt;]
Junio C Hamanoc21ab052009-10-31 04:03:55752</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59753<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55754--no-log
755</dt>
756<dd>
757<p>
758 In addition to branch names, populate the log message with
Junio C Hamano3b4609d2010-09-30 00:04:34759 one-line descriptions from at most &lt;n&gt; actual commits that are being
Junio C Hamanoa28a9202012-06-21 07:08:23760 merged. See also <a href="git-fmt-merge-msg.html">git-fmt-merge-msg(1)</a>.
Junio C Hamanoc21ab052009-10-31 04:03:55761</p>
Junio C Hamano68cf15a2010-11-06 01:01:59762<div class="paragraph"><p>With --no-log do not list one-line descriptions from the
Junio C Hamanoc21ab052009-10-31 04:03:55763actual commits being merged.</p></div>
764</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59765<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55766--stat
767</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59768<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55769-n
770</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59771<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55772--no-stat
773</dt>
774<dd>
775<p>
776 Show a diffstat at the end of the merge. The diffstat is also
777 controlled by the configuration option merge.stat.
778</p>
Junio C Hamano68cf15a2010-11-06 01:01:59779<div class="paragraph"><p>With -n or --no-stat do not show a diffstat at the end of the
Junio C Hamanoc21ab052009-10-31 04:03:55780merge.</p></div>
781</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59782<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55783--squash
784</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59785<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55786--no-squash
787</dt>
788<dd>
789<p>
790 Produce the working tree and index state as if a real
791 merge happened (except for the merge information),
792 but do not actually make a commit or
793 move the <tt>HEAD</tt>, nor record <tt>$GIT_DIR/MERGE_HEAD</tt> to
794 cause the next <tt>git commit</tt> command to create a merge
795 commit. This allows you to create a single commit on
796 top of the current branch whose effect is the same as
797 merging another branch (or more in case of an octopus).
798</p>
Junio C Hamano68cf15a2010-11-06 01:01:59799<div class="paragraph"><p>With --no-squash perform the merge and commit the result. This
Junio C Hamanoc21ab052009-10-31 04:03:55800option can be used to override --squash.</p></div>
801</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59802<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55803-s &lt;strategy&gt;
804</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59805<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55806--strategy=&lt;strategy&gt;
807</dt>
808<dd>
809<p>
810 Use the given merge strategy; can be supplied more than
811 once to specify them in the order they should be tried.
812 If there is no <tt>-s</tt> option, a built-in list of strategies
Junio C Hamano1aa40d22010-01-21 17:46:43813 is used instead (<em>git merge-recursive</em> when merging a single
814 head, <em>git merge-octopus</em> otherwise).
Junio C Hamanoc21ab052009-10-31 04:03:55815</p>
816</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59817<dt class="hdlist1">
Junio C Hamanob04bb3f2010-04-14 14:07:36818-X &lt;option&gt;
819</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59820<dt class="hdlist1">
Junio C Hamanob04bb3f2010-04-14 14:07:36821--strategy-option=&lt;option&gt;
822</dt>
823<dd>
824<p>
825 Pass merge strategy specific option through to the merge
826 strategy.
827</p>
828</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59829<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55830--summary
831</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59832<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55833--no-summary
834</dt>
835<dd>
836<p>
837 Synonyms to --stat and --no-stat; these are deprecated and will be
838 removed in the future.
839</p>
840</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59841<dt class="hdlist1">
Junio C Hamano610d1762008-11-28 06:27:13842-q
843</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59844<dt class="hdlist1">
Junio C Hamano610d1762008-11-28 06:27:13845--quiet
846</dt>
847<dd>
848<p>
Junio C Hamanod2c978f2011-03-20 19:42:22849 Operate quietly. Implies --no-progress.
Junio C Hamano610d1762008-11-28 06:27:13850</p>
851</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59852<dt class="hdlist1">
Junio C Hamano610d1762008-11-28 06:27:13853-v
854</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59855<dt class="hdlist1">
Junio C Hamano610d1762008-11-28 06:27:13856--verbose
857</dt>
858<dd>
859<p>
860 Be verbose.
861</p>
862</dd>
Junio C Hamanod2c978f2011-03-20 19:42:22863<dt class="hdlist1">
864--progress
865</dt>
866<dt class="hdlist1">
867--no-progress
868</dt>
869<dd>
870<p>
871 Turn progress on/off explicitly. If neither is specified,
872 progress is shown if standard error is connected to a terminal.
873 Note that not all merge strategies may support progress
874 reporting.
875</p>
876</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31877</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:59878<div class="dlist"><dl>
879<dt class="hdlist1">
Junio C Hamano6d559fc2008-02-20 10:44:26880--rebase
881</dt>
882<dd>
883<p>
Junio C Hamano982eb112010-11-18 00:53:09884 Rebase the current branch on top of the upstream branch after
885 fetching. If there is a remote-tracking branch corresponding to
886 the upstream branch and the upstream branch was rebased since last
887 fetched, the rebase uses that information to avoid rebasing
888 non-local changes.
Junio C Hamano6d559fc2008-02-20 10:44:26889</p>
Junio C Hamano515ab1d2011-12-09 23:41:20890<div class="paragraph"><p>See <tt>pull.rebase</tt>, <tt>branch.&lt;name&gt;.rebase</tt> and <tt>branch.autosetuprebase</tt> in
Junio C Hamanoa28a9202012-06-21 07:08:23891<a href="git-config.html">git-config(1)</a> if you want to make <tt>git pull</tt> always use
Junio C Hamanob76a6862012-05-02 22:02:46892<tt>--rebase</tt> instead of merging.</p></div>
Junio C Hamano6fb124c2008-06-13 10:04:01893<div class="admonitionblock">
894<table><tr>
895<td class="icon">
896<div class="title">Note</div>
897</td>
Junio C Hamano68cf15a2010-11-06 01:01:59898<td class="content">This is a potentially <em>dangerous</em> mode of operation.
Junio C Hamano6d559fc2008-02-20 10:44:26899It rewrites history, which does not bode well when you
900published that history already. Do <strong>not</strong> use this option
Junio C Hamanoa28a9202012-06-21 07:08:23901unless you have read <a href="git-rebase.html">git-rebase(1)</a> carefully.</td>
Junio C Hamano6fb124c2008-06-13 10:04:01902</tr></table>
903</div>
Junio C Hamano6d559fc2008-02-20 10:44:26904</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59905<dt class="hdlist1">
Junio C Hamano6d559fc2008-02-20 10:44:26906--no-rebase
907</dt>
908<dd>
909<p>
910 Override earlier --rebase.
911</p>
912</dd>
Junio C Hamanoc21ab052009-10-31 04:03:55913</dl></div>
914<h3 id="_options_related_to_fetching">Options related to fetching</h3><div style="clear:left"></div>
Junio C Hamano68cf15a2010-11-06 01:01:59915<div class="dlist"><dl>
916<dt class="hdlist1">
Junio C Hamano9df0c662009-11-23 11:09:27917--all
918</dt>
919<dd>
920<p>
921 Fetch all remotes.
922</p>
923</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59924<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47925-a
926</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59927<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47928--append
Junio C Hamano1a4e8412005-12-27 08:17:23929</dt>
930<dd>
931<p>
932 Append ref names and object names of fetched refs to the
933 existing contents of <tt>.git/FETCH_HEAD</tt>. Without this
934 option old data in <tt>.git/FETCH_HEAD</tt> will be overwritten.
935</p>
936</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59937<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55938--depth=&lt;depth&gt;
Junio C Hamanoe663a7a2006-01-25 12:37:28939</dt>
Junio C Hamanoe663a7a2006-01-25 12:37:28940<dd>
941<p>
Junio C Hamanoc21ab052009-10-31 04:03:55942 Deepen the history of a <em>shallow</em> repository created by
Junio C Hamanoa28a9202012-06-21 07:08:23943 <tt>git clone</tt> with <tt>--depth=&lt;depth&gt;</tt> option (see <a href="git-clone.html">git-clone(1)</a>)
Junio C Hamanoc21ab052009-10-31 04:03:55944 by the specified number of commits.
Junio C Hamanoe663a7a2006-01-25 12:37:28945</p>
946</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59947<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47948-f
949</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59950<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47951--force
Junio C Hamano1a4e8412005-12-27 08:17:23952</dt>
953<dd>
954<p>
Junio C Hamano1aa40d22010-01-21 17:46:43955 When <em>git fetch</em> is used with <tt>&lt;rbranch&gt;:&lt;lbranch&gt;</tt>
Junio C Hamano1a4e8412005-12-27 08:17:23956 refspec, it refuses to update the local branch
957 <tt>&lt;lbranch&gt;</tt> unless the remote branch <tt>&lt;rbranch&gt;</tt> it
958 fetches is a descendant of <tt>&lt;lbranch&gt;</tt>. This option
959 overrides that check.
960</p>
961</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59962<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55963-k
964</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59965<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55966--keep
967</dt>
968<dd>
969<p>
970 Keep downloaded pack.
971</p>
972</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59973<dt class="hdlist1">
Junio C Hamanof7bb6692008-01-27 08:23:46974--no-tags
Junio C Hamano4d04a402006-01-09 00:53:28975</dt>
976<dd>
977<p>
Junio C Hamanof7bb6692008-01-27 08:23:46978 By default, tags that point at objects that are downloaded
979 from the remote repository are fetched and stored locally.
Junio C Hamano075ae872010-09-01 18:43:07980 This option disables this automatic tag following. The default
981 behavior for a remote may be specified with the remote.&lt;name&gt;.tagopt
Junio C Hamanoa28a9202012-06-21 07:08:23982 setting. See <a href="git-config.html">git-config(1)</a>.
Junio C Hamano4d04a402006-01-09 00:53:28983</p>
984</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59985<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47986-u
987</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59988<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47989--update-head-ok
Junio C Hamano1a4e8412005-12-27 08:17:23990</dt>
991<dd>
992<p>
Junio C Hamano1aa40d22010-01-21 17:46:43993 By default <em>git fetch</em> refuses to update the head which
Junio C Hamano1a4e8412005-12-27 08:17:23994 corresponds to the current branch. This flag disables the
Junio C Hamano1aa40d22010-01-21 17:46:43995 check. This is purely for the internal use for <em>git pull</em>
996 to communicate with <em>git fetch</em>, and unless you are
Junio C Hamanob288d9e2007-01-02 00:04:15997 implementing your own Porcelain you are not supposed to
998 use it.
999</p>
1000</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591001<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551002--upload-pack &lt;upload-pack&gt;
Junio C Hamanob288d9e2007-01-02 00:04:151003</dt>
1004<dd>
1005<p>
Junio C Hamanoc21ab052009-10-31 04:03:551006 When given, and the repository to fetch from is handled
Junio C Hamano1aa40d22010-01-21 17:46:431007 by <em>git fetch-pack</em>, <em>--exec=&lt;upload-pack&gt;</em> is passed to
Junio C Hamanoc21ab052009-10-31 04:03:551008 the command to specify non-default path for the command
1009 run on the other end.
Junio C Hamano1a4e8412005-12-27 08:17:231010</p>
1011</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591012<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:551013--progress
1014</dt>
1015<dd>
1016<p>
1017 Progress status is reported on the standard error stream
1018 by default when it is attached to a terminal, unless -q
1019 is specified. This flag forces progress status even if the
1020 standard error stream is not directed to a terminal.
1021</p>
1022</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591023<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231024&lt;repository&gt;
1025</dt>
1026<dd>
1027<p>
1028 The "remote" repository that is the source of a fetch
Junio C Hamano054ea082008-06-01 08:26:341029 or pull operation. This parameter can be either a URL
1030 (see the section <a href="#URLS">GIT URLS</a> below) or the name
1031 of a remote (see the section <a href="#REMOTES">REMOTES</a> below).
Junio C Hamano1a4e8412005-12-27 08:17:231032</p>
Junio C Hamano40f2f8d2006-02-07 08:04:391033</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591034<dt class="hdlist1">
Junio C Hamano40f2f8d2006-02-07 08:04:391035&lt;refspec&gt;
1036</dt>
1037<dd>
1038<p>
Junio C Hamano8b6e23b2009-02-01 06:36:081039 The format of a &lt;refspec&gt; parameter is an optional plus
Junio C Hamanob76a6862012-05-02 22:02:461040 <tt>+</tt>, followed by the source ref &lt;src&gt;, followed
Junio C Hamano8b6e23b2009-02-01 06:36:081041 by a colon <tt>:</tt>, followed by the destination ref &lt;dst&gt;.
Junio C Hamano40f2f8d2006-02-07 08:04:391042</p>
Junio C Hamano68cf15a2010-11-06 01:01:591043<div class="paragraph"><p>The remote ref that matches &lt;src&gt;
Junio C Hamano40f2f8d2006-02-07 08:04:391044is fetched, and if &lt;dst&gt; is not empty string, the local
Junio C Hamano3f680f32009-11-16 02:10:541045ref that matches it is fast-forwarded using &lt;src&gt;.
Junio C Hamano8b6e23b2009-02-01 06:36:081046If the optional plus <tt>+</tt> is used, the local ref
Junio C Hamano3f680f32009-11-16 02:10:541047is updated even if it does not result in a fast-forward
Junio C Hamanoba4b9282008-07-06 05:20:311048update.</p></div>
Junio C Hamano40f2f8d2006-02-07 08:04:391049<div class="admonitionblock">
1050<table><tr>
1051<td class="icon">
1052<div class="title">Note</div>
1053</td>
1054<td class="content">If the remote branch from which you want to pull is
1055modified in non-linear ways such as being rewound and
1056rebased frequently, then a pull will attempt a merge with
1057an older version of itself, likely conflict, and fail.
1058It is under these conditions that you would want to use
1059the <tt>+</tt> sign to indicate non-fast-forward updates will
1060be needed. There is currently no easy way to determine
1061or declare that a branch will be made available in a
1062repository with this behavior; the pulling user simply
1063must know this is the expected usage pattern for a branch.</td>
1064</tr></table>
1065</div>
1066<div class="admonitionblock">
1067<table><tr>
1068<td class="icon">
1069<div class="title">Note</div>
1070</td>
1071<td class="content">You never do your own development on branches that appear
1072on the right hand side of a &lt;refspec&gt; colon on <tt>Pull:</tt> lines;
Junio C Hamano1aa40d22010-01-21 17:46:431073they are to be updated by <em>git fetch</em>. If you intend to do
Junio C Hamano40f2f8d2006-02-07 08:04:391074development derived from a remote branch <tt>B</tt>, have a <tt>Pull:</tt>
1075line to track it (i.e. <tt>Pull: B:remote-B</tt>), and have a separate
1076branch <tt>my-B</tt> to do your development on top of it. The latter
1077is created by <tt>git branch my-B remote-B</tt> (or its equivalent <tt>git
1078checkout -b my-B remote-B</tt>). Run <tt>git fetch</tt> to keep track of
1079the progress of the remote side, and when you see something new
1080on the remote branch, merge it into your development branch with
Junio C Hamanob288d9e2007-01-02 00:04:151081<tt>git pull . remote-B</tt>, while you are on <tt>my-B</tt> branch.</td>
Junio C Hamano40f2f8d2006-02-07 08:04:391082</tr></table>
1083</div>
1084<div class="admonitionblock">
1085<table><tr>
1086<td class="icon">
1087<div class="title">Note</div>
1088</td>
1089<td class="content">There is a difference between listing multiple &lt;refspec&gt;
Junio C Hamano1aa40d22010-01-21 17:46:431090directly on <em>git pull</em> command line and having multiple
Junio C Hamano40f2f8d2006-02-07 08:04:391091<tt>Pull:</tt> &lt;refspec&gt; lines for a &lt;repository&gt; and running
Junio C Hamano1aa40d22010-01-21 17:46:431092<em>git pull</em> command without any explicit &lt;refspec&gt; parameters.
Junio C Hamano40f2f8d2006-02-07 08:04:391093&lt;refspec&gt; listed explicitly on the command line are always
1094merged into the current branch after fetching. In other words,
1095if you list more than one remote refs, you would be making
Junio C Hamano1aa40d22010-01-21 17:46:431096an Octopus. While <em>git pull</em> run without any explicit &lt;refspec&gt;
Junio C Hamano40f2f8d2006-02-07 08:04:391097parameter takes default &lt;refspec&gt;s from <tt>Pull:</tt> lines, it
1098merges only the first &lt;refspec&gt; found into the current branch,
1099after fetching all the remote refs. This is because making an
1100Octopus from remote refs is rarely done, while keeping track
1101of multiple remote heads in one-go by fetching more than one
1102is often useful.</td>
1103</tr></table>
1104</div>
Junio C Hamano68cf15a2010-11-06 01:01:591105<div class="paragraph"><p>Some short-cut notations are also supported.</p></div>
1106<div class="ulist"><ul>
Junio C Hamano40f2f8d2006-02-07 08:04:391107<li>
1108<p>
1109<tt>tag &lt;tag&gt;</tt> means the same as <tt>refs/tags/&lt;tag&gt;:refs/tags/&lt;tag&gt;</tt>;
1110 it requests fetching everything up to the given tag.
1111</p>
1112</li>
1113<li>
1114<p>
1115A parameter &lt;ref&gt; without a colon is equivalent to
1116 &lt;ref&gt;: when pulling/fetching, so it merges &lt;ref&gt; into the current
1117 branch without storing the remote branch anywhere locally
1118</p>
1119</li>
Junio C Hamanoba4b9282008-07-06 05:20:311120</ul></div>
Junio C Hamano40f2f8d2006-02-07 08:04:391121</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311122</dl></div>
Junio C Hamano40f2f8d2006-02-07 08:04:391123</div>
Junio C Hamanoba4b9282008-07-06 05:20:311124<h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2>
Junio C Hamano40f2f8d2006-02-07 08:04:391125<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591126<div class="paragraph"><p>In general, URLs contain information about the transport protocol, the
Junio C Hamano0c053e82010-04-19 06:46:341127address of the remote server, and the path to the repository.
1128Depending on the transport protocol, some of this information may be
1129absent.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591130<div class="paragraph"><p>Git natively supports ssh, git, http, https, ftp, ftps, and rsync
Junio C Hamano0c053e82010-04-19 06:46:341131protocols. The following syntaxes may be used with them:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591132<div class="ulist"><ul>
Junio C Hamano1a4e8412005-12-27 08:17:231133<li>
1134<p>
Junio C Hamano0c053e82010-04-19 06:46:341135ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:231136</p>
1137</li>
1138<li>
1139<p>
Junio C Hamanoa3bb6eb2009-02-05 01:26:331140git://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:231141</p>
1142</li>
1143<li>
1144<p>
Junio C Hamano0c053e82010-04-19 06:46:341145http&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:231146</p>
1147</li>
1148<li>
1149<p>
Junio C Hamano0c053e82010-04-19 06:46:341150ftp&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamanodbb64592007-09-01 11:17:391151</p>
1152</li>
1153<li>
1154<p>
Junio C Hamano0c053e82010-04-19 06:46:341155rsync://host.xz/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:231156</p>
1157</li>
Junio C Hamanoba4b9282008-07-06 05:20:311158</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591159<div class="paragraph"><p>An alternative scp-like syntax may also be used with the ssh protocol:</p></div>
1160<div class="ulist"><ul>
Junio C Hamano1a4e8412005-12-27 08:17:231161<li>
1162<p>
Junio C Hamano0c053e82010-04-19 06:46:341163&#91;user@&#93;host.xz:path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:231164</p>
1165</li>
Junio C Hamanoba4b9282008-07-06 05:20:311166</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591167<div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
1168<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:341169<li>
1170<p>
1171ssh://&#91;user@&#93;host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1172</p>
1173</li>
1174<li>
1175<p>
1176git://host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1177</p>
1178</li>
1179<li>
1180<p>
1181&#91;user@&#93;host.xz:/~&#91;user&#93;/path/to/repo.git/
1182</p>
1183</li>
1184</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591185<div class="paragraph"><p>For local repositories, also supported by git natively, the following
Junio C Hamano0c053e82010-04-19 06:46:341186syntaxes may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591187<div class="ulist"><ul>
Junio C Hamano1a4e8412005-12-27 08:17:231188<li>
1189<p>
1190/path/to/repo.git/
1191</p>
1192</li>
Junio C Hamanob1d6e882007-08-11 08:30:161193<li>
1194<p>
Junio C Hamano68cf15a2010-11-06 01:01:591195<a href="file:///path/to/repo.git/">file:///path/to/repo.git/</a>
Junio C Hamanob1d6e882007-08-11 08:30:161196</p>
1197</li>
Junio C Hamanoba4b9282008-07-06 05:20:311198</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591199<div class="paragraph"><p>These two syntaxes are mostly equivalent, except when cloning, when
Junio C Hamanoa28a9202012-06-21 07:08:231200the former implies --local option. See <a href="git-clone.html">git-clone(1)</a> for
Junio C Hamano0c053e82010-04-19 06:46:341201details.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591202<div class="paragraph"><p>When git doesn&#8217;t know how to handle a certain transport protocol, it
Junio C Hamano0c053e82010-04-19 06:46:341203attempts to use the <em>remote-&lt;transport&gt;</em> remote helper, if one
1204exists. To explicitly request a remote helper, the following syntax
1205may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591206<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:341207<li>
1208<p>
1209&lt;transport&gt;::&lt;address&gt;
1210</p>
1211</li>
1212</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591213<div class="paragraph"><p>where &lt;address&gt; may be a path, a server and path, or an arbitrary
Junio C Hamano0c053e82010-04-19 06:46:341214URL-like string recognized by the specific remote helper being
Junio C Hamanoa28a9202012-06-21 07:08:231215invoked. See <a href="git-remote-helpers.html">git-remote-helpers(1)</a> for details.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591216<div class="paragraph"><p>If there are a large number of similarly-named remote repositories and
Junio C Hamano24bc09a2008-02-28 00:27:441217you want to use a different format for them (such that the URLs you
1218use will be rewritten into URLs that work), you can create a
Junio C Hamanoba4b9282008-07-06 05:20:311219configuration section of the form:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441220<div class="listingblock">
1221<div class="content">
1222<pre><tt> [url "&lt;actual url base&gt;"]
1223 insteadOf = &lt;other url base&gt;</tt></pre>
1224</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591225<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441226<div class="listingblock">
1227<div class="content">
1228<pre><tt> [url "git://git.host.xz/"]
1229 insteadOf = host.xz:/path/to/
1230 insteadOf = work:</tt></pre>
1231</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591232<div class="paragraph"><p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
Junio C Hamanoba4b9282008-07-06 05:20:311233rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591234<div class="paragraph"><p>If you want to rewrite URLs for push only, you can create a
Junio C Hamano7df6dcf2009-09-13 09:51:171235configuration section of the form:</p></div>
1236<div class="listingblock">
1237<div class="content">
1238<pre><tt> [url "&lt;actual url base&gt;"]
1239 pushInsteadOf = &lt;other url base&gt;</tt></pre>
1240</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591241<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano7df6dcf2009-09-13 09:51:171242<div class="listingblock">
1243<div class="content">
1244<pre><tt> [url "ssh://example.org/"]
1245 pushInsteadOf = git://example.org/</tt></pre>
1246</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591247<div class="paragraph"><p>a URL like "git://example.org/path/to/repo.git" will be rewritten to
Junio C Hamano7df6dcf2009-09-13 09:51:171248"ssh://example.org/path/to/repo.git" for pushes, but pulls will still
1249use the original URL.</p></div>
Junio C Hamano40f2f8d2006-02-07 08:04:391250</div>
Junio C Hamanoba4b9282008-07-06 05:20:311251<h2 id="_remotes_a_id_remotes_a">REMOTES<a id="REMOTES"></a></h2>
Junio C Hamano40f2f8d2006-02-07 08:04:391252<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591253<div class="paragraph"><p>The name of one of the following can be used instead
Junio C Hamanoba4b9282008-07-06 05:20:311254of a URL as <tt>&lt;repository&gt;</tt> argument:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591255<div class="ulist"><ul>
Junio C Hamano054ea082008-06-01 08:26:341256<li>
1257<p>
1258a remote in the git configuration file: <tt>$GIT_DIR/config</tt>,
1259</p>
1260</li>
1261<li>
1262<p>
1263a file in the <tt>$GIT_DIR/remotes</tt> directory, or
1264</p>
1265</li>
1266<li>
1267<p>
1268a file in the <tt>$GIT_DIR/branches</tt> directory.
1269</p>
1270</li>
Junio C Hamanoba4b9282008-07-06 05:20:311271</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591272<div class="paragraph"><p>All of these also allow you to omit the refspec from the command line
Junio C Hamanoba4b9282008-07-06 05:20:311273because they each contain a refspec which git will use by default.</p></div>
1274<h3 id="_named_remote_in_configuration_file">Named remote in configuration file</h3><div style="clear:left"></div>
Junio C Hamano68cf15a2010-11-06 01:01:591275<div class="paragraph"><p>You can choose to provide the name of a remote which you had previously
Junio C Hamanoa28a9202012-06-21 07:08:231276configured using <a href="git-remote.html">git-remote(1)</a>, <a href="git-config.html">git-config(1)</a>
Junio C Hamano054ea082008-06-01 08:26:341277or even by a manual edit to the <tt>$GIT_DIR/config</tt> file. The URL of
1278this remote will be used to access the repository. The refspec
1279of this remote will be used by default when you do
1280not provide a refspec on the command line. The entry in the
Junio C Hamanoba4b9282008-07-06 05:20:311281config file would appear like this:</p></div>
Junio C Hamano054ea082008-06-01 08:26:341282<div class="listingblock">
1283<div class="content">
1284<pre><tt> [remote "&lt;name&gt;"]
1285 url = &lt;url&gt;
Junio C Hamano0e88f3e2009-06-21 08:03:251286 pushurl = &lt;pushurl&gt;
Junio C Hamano054ea082008-06-01 08:26:341287 push = &lt;refspec&gt;
1288 fetch = &lt;refspec&gt;</tt></pre>
1289</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591290<div class="paragraph"><p>The <tt>&lt;pushurl&gt;</tt> is used for pushes only. It is optional and defaults
Junio C Hamano0e88f3e2009-06-21 08:03:251291to <tt>&lt;url&gt;</tt>.</p></div>
Junio C Hamanoba4b9282008-07-06 05:20:311292<h3 id="_named_file_in_tt_git_dir_remotes_tt">Named file in <tt>$GIT_DIR/remotes</tt></h3><div style="clear:left"></div>
Junio C Hamano68cf15a2010-11-06 01:01:591293<div class="paragraph"><p>You can choose to provide the name of a
Junio C Hamano054ea082008-06-01 08:26:341294file in <tt>$GIT_DIR/remotes</tt>. The URL
1295in this file will be used to access the repository. The refspec
1296in this file will be used as default when you do not
1297provide a refspec on the command line. This file should have the
Junio C Hamanoba4b9282008-07-06 05:20:311298following format:</p></div>
Junio C Hamano1caaf472006-12-31 08:29:351299<div class="listingblock">
Junio C Hamano1a4e8412005-12-27 08:17:231300<div class="content">
Junio C Hamanod3361ad2007-01-01 03:20:241301<pre><tt> URL: one of the above URL format
1302 Push: &lt;refspec&gt;
Junio C Hamano68cf15a2010-11-06 01:01:591303 Pull: &lt;refspec&gt;</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231304</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591305<div class="paragraph"><p><tt>Push:</tt> lines are used by <em>git push</em> and
Junio C Hamano1aa40d22010-01-21 17:46:431306<tt>Pull:</tt> lines are used by <em>git pull</em> and <em>git fetch</em>.
Junio C Hamano054ea082008-06-01 08:26:341307Multiple <tt>Push:</tt> and <tt>Pull:</tt> lines may
Junio C Hamanoba4b9282008-07-06 05:20:311308be specified for additional branch mappings.</p></div>
1309<h3 id="_named_file_in_tt_git_dir_branches_tt">Named file in <tt>$GIT_DIR/branches</tt></h3><div style="clear:left"></div>
Junio C Hamano68cf15a2010-11-06 01:01:591310<div class="paragraph"><p>You can choose to provide the name of a
Junio C Hamano054ea082008-06-01 08:26:341311file in <tt>$GIT_DIR/branches</tt>.
1312The URL in this file will be used to access the repository.
Junio C Hamanoba4b9282008-07-06 05:20:311313This file should have the following format:</p></div>
Junio C Hamano1caaf472006-12-31 08:29:351314<div class="listingblock">
Junio C Hamano249572f2006-10-24 05:44:081315<div class="content">
Junio C Hamano054ea082008-06-01 08:26:341316<pre><tt> &lt;url&gt;#&lt;head&gt;</tt></pre>
Junio C Hamano249572f2006-10-24 05:44:081317</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591318<div class="paragraph"><p><tt>&lt;url&gt;</tt> is required; <tt>#&lt;head&gt;</tt> is optional.</p></div>
1319<div class="paragraph"><p>Depending on the operation, git will use one of the following
1320refspecs, if you don&#8217;t provide one on the command line.
Junio C Hamano28363492008-11-14 08:26:311321<tt>&lt;branch&gt;</tt> is the name of this file in <tt>$GIT_DIR/branches</tt> and
1322<tt>&lt;head&gt;</tt> defaults to <tt>master</tt>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591323<div class="paragraph"><p>git fetch uses:</p></div>
Junio C Hamano1caaf472006-12-31 08:29:351324<div class="listingblock">
Junio C Hamano1a4e8412005-12-27 08:17:231325<div class="content">
Junio C Hamano28363492008-11-14 08:26:311326<pre><tt> refs/heads/&lt;head&gt;:refs/heads/&lt;branch&gt;</tt></pre>
1327</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591328<div class="paragraph"><p>git push uses:</p></div>
Junio C Hamano28363492008-11-14 08:26:311329<div class="listingblock">
1330<div class="content">
1331<pre><tt> HEAD:refs/heads/&lt;head&gt;</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231332</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:231333</div>
Junio C Hamanoba4b9282008-07-06 05:20:311334<h2 id="_merge_strategies">MERGE STRATEGIES</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231335<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591336<div class="paragraph"><p>The merge mechanism (<em>git-merge</em> and <em>git-pull</em> commands) allows the
Junio C Hamano1aa40d22010-01-21 17:46:431337backend <em>merge strategies</em> to be chosen with <tt>-s</tt> option. Some strategies
1338can also take their own options, which can be passed by giving <tt>-X&lt;option&gt;</tt>
1339arguments to <em>git-merge</em> and/or <em>git-pull</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591340<div class="dlist"><dl>
1341<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231342resolve
1343</dt>
1344<dd>
1345<p>
1346 This can only resolve two heads (i.e. the current branch
Junio C Hamano1de75722009-03-26 08:39:381347 and another branch you pulled from) using a 3-way merge
Junio C Hamano1a4e8412005-12-27 08:17:231348 algorithm. It tries to carefully detect criss-cross
1349 merge ambiguities and is considered generally safe and
1350 fast.
1351</p>
1352</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591353<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231354recursive
1355</dt>
1356<dd>
1357<p>
Junio C Hamano1de75722009-03-26 08:39:381358 This can only resolve two heads using a 3-way merge
1359 algorithm. When there is more than one common
1360 ancestor that can be used for 3-way merge, it creates a
Junio C Hamano1a4e8412005-12-27 08:17:231361 merged tree of the common ancestors and uses that as
1362 the reference tree for the 3-way merge. This has been
1363 reported to result in fewer merge conflicts without
1364 causing mis-merges by tests done on actual merge commits
1365 taken from Linux 2.6 kernel development history.
1366 Additionally this can detect and handle merges involving
1367 renames. This is the default merge strategy when
1368 pulling or merging one branch.
1369</p>
Junio C Hamano68cf15a2010-11-06 01:01:591370<div class="paragraph"><p>The <em>recursive</em> strategy can take the following options:</p></div>
1371<div class="dlist"><dl>
1372<dt class="hdlist1">
Junio C Hamano1aa40d22010-01-21 17:46:431373ours
1374</dt>
1375<dd>
1376<p>
1377 This option forces conflicting hunks to be auto-resolved cleanly by
1378 favoring <em>our</em> version. Changes from the other tree that do not
1379 conflict with our side are reflected to the merge result.
1380</p>
Junio C Hamano68cf15a2010-11-06 01:01:591381<div class="paragraph"><p>This should not be confused with the <em>ours</em> merge strategy, which does not
Junio C Hamano1aa40d22010-01-21 17:46:431382even look at what the other tree contains at all. It discards everything
1383the other tree did, declaring <em>our</em> history contains all that happened in it.</p></div>
1384</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591385<dt class="hdlist1">
Junio C Hamano1aa40d22010-01-21 17:46:431386theirs
1387</dt>
1388<dd>
1389<p>
1390 This is opposite of <em>ours</em>.
1391</p>
1392</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591393<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541394patience
1395</dt>
1396<dd>
1397<p>
1398 With this option, <em>merge-recursive</em> spends a little extra time
1399 to avoid mismerges that sometimes occur due to unimportant
1400 matching lines (e.g., braces from distinct functions). Use
1401 this when the branches to be merged have diverged wildly.
Junio C Hamanoa28a9202012-06-21 07:08:231402 See also <a href="git-diff.html">git-diff(1)</a> <tt>--patience</tt>.
Junio C Hamano39c7a692010-10-27 06:08:541403</p>
1404</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591405<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541406ignore-space-change
1407</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591408<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541409ignore-all-space
1410</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591411<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541412ignore-space-at-eol
1413</dt>
1414<dd>
1415<p>
1416 Treats lines with the indicated type of whitespace change as
1417 unchanged for the sake of a three-way merge. Whitespace
1418 changes mixed with other changes to a line are not ignored.
Junio C Hamanoa28a9202012-06-21 07:08:231419 See also <a href="git-diff.html">git-diff(1)</a> <tt>-b</tt>, <tt>-w</tt>, and
Junio C Hamano39c7a692010-10-27 06:08:541420 <tt>--ignore-space-at-eol</tt>.
1421</p>
Junio C Hamano68cf15a2010-11-06 01:01:591422<div class="ulist"><ul>
Junio C Hamano39c7a692010-10-27 06:08:541423<li>
1424<p>
1425If <em>their</em> version only introduces whitespace changes to a line,
1426 <em>our</em> version is used;
1427</p>
1428</li>
1429<li>
1430<p>
1431If <em>our</em> version introduces whitespace changes but <em>their</em>
1432 version includes a substantial change, <em>their</em> version is used;
1433</p>
1434</li>
1435<li>
1436<p>
1437Otherwise, the merge proceeds in the usual way.
1438</p>
1439</li>
1440</ul></div>
1441</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591442<dt class="hdlist1">
Junio C Hamano2db3e752010-09-03 21:33:061443renormalize
1444</dt>
1445<dd>
1446<p>
1447 This runs a virtual check-out and check-in of all three stages
1448 of a file when resolving a three-way merge. This option is
1449 meant to be used when merging branches with different clean
1450 filters or end-of-line normalization rules. See "Merging
1451 branches with differing checkin/checkout attributes" in
Junio C Hamanoa28a9202012-06-21 07:08:231452 <a href="gitattributes.html">gitattributes(5)</a> for details.
Junio C Hamano2db3e752010-09-03 21:33:061453</p>
1454</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591455<dt class="hdlist1">
Junio C Hamano2db3e752010-09-03 21:33:061456no-renormalize
1457</dt>
1458<dd>
1459<p>
1460 Disables the <tt>renormalize</tt> option. This overrides the
1461 <tt>merge.renormalize</tt> configuration variable.
1462</p>
1463</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591464<dt class="hdlist1">
Junio C Hamano39c7a692010-10-27 06:08:541465rename-threshold=&lt;n&gt;
1466</dt>
1467<dd>
1468<p>
1469 Controls the similarity threshold used for rename detection.
Junio C Hamanoa28a9202012-06-21 07:08:231470 See also <a href="git-diff.html">git-diff(1)</a> <tt>-M</tt>.
Junio C Hamano39c7a692010-10-27 06:08:541471</p>
1472</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591473<dt class="hdlist1">
Junio C Hamanod2179ef2010-10-22 04:12:171474subtree[=&lt;path&gt;]
Junio C Hamano1aa40d22010-01-21 17:46:431475</dt>
1476<dd>
1477<p>
1478 This option is a more advanced form of <em>subtree</em> strategy, where
1479 the strategy makes a guess on how two trees must be shifted to
1480 match with each other when merging. Instead, the specified path
1481 is prefixed (or stripped from the beginning) to make the shape of
1482 two trees to match.
1483</p>
1484</dd>
1485</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231486</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591487<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231488octopus
1489</dt>
1490<dd>
1491<p>
Junio C Hamano1de75722009-03-26 08:39:381492 This resolves cases with more than two heads, but refuses to do
1493 a complex merge that needs manual resolution. It is
Junio C Hamano1a4e8412005-12-27 08:17:231494 primarily meant to be used for bundling topic branch
1495 heads together. This is the default merge strategy when
Junio C Hamano1de75722009-03-26 08:39:381496 pulling or merging more than one branch.
Junio C Hamano1a4e8412005-12-27 08:17:231497</p>
1498</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591499<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231500ours
1501</dt>
1502<dd>
1503<p>
Junio C Hamanobf984de2009-11-23 06:11:191504 This resolves any number of heads, but the resulting tree of the
1505 merge is always that of the current branch head, effectively
1506 ignoring all changes from all other branches. It is meant to
Junio C Hamano1a4e8412005-12-27 08:17:231507 be used to supersede old development history of side
Junio C Hamano1aa40d22010-01-21 17:46:431508 branches. Note that this is different from the -Xours option to
1509 the <em>recursive</em> merge strategy.
Junio C Hamano1a4e8412005-12-27 08:17:231510</p>
1511</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591512<dt class="hdlist1">
Junio C Hamanoe6c92032008-03-19 09:24:341513subtree
1514</dt>
1515<dd>
1516<p>
1517 This is a modified recursive strategy. When merging trees A and
1518 B, if B corresponds to a subtree of A, B is first adjusted to
1519 match the tree structure of A, instead of reading the trees at
1520 the same level. This adjustment is also done to the common
1521 ancestor tree.
1522</p>
1523</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311524</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231525</div>
Junio C Hamanoba4b9282008-07-06 05:20:311526<h2 id="_default_behaviour">DEFAULT BEHAVIOUR</h2>
Junio C Hamanod3339982007-02-09 08:38:481527<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591528<div class="paragraph"><p>Often people use <tt>git pull</tt> without giving any parameter.
Junio C Hamanod3339982007-02-09 08:38:481529Traditionally, this has been equivalent to saying <tt>git pull
1530origin</tt>. However, when configuration <tt>branch.&lt;name&gt;.remote</tt> is
1531present while on branch <tt>&lt;name&gt;</tt>, that value is used instead of
Junio C Hamanoba4b9282008-07-06 05:20:311532<tt>origin</tt>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591533<div class="paragraph"><p>In order to determine what URL to use to fetch from, the value
Junio C Hamanod3339982007-02-09 08:38:481534of the configuration <tt>remote.&lt;origin&gt;.url</tt> is consulted
Junio C Hamano68cf15a2010-11-06 01:01:591535and if there is not any such variable, the value on <tt>URL: ` line
1536in `$GIT_DIR/remotes/&lt;origin&gt;</tt> file is used.</p></div>
1537<div class="paragraph"><p>In order to determine what remote branches to fetch (and
Junio C Hamano97bcb482010-11-25 03:16:071538optionally store in the remote-tracking branches) when the command is
Junio C Hamanod3339982007-02-09 08:38:481539run without any refspec parameters on the command line, values
1540of the configuration variable <tt>remote.&lt;origin&gt;.fetch</tt> are
Junio C Hamano68cf15a2010-11-06 01:01:591541consulted, and if there aren&#8217;t any, <tt>$GIT_DIR/remotes/&lt;origin&gt;</tt>
1542file is consulted and its `Pull: ` lines are used.
Junio C Hamanod3339982007-02-09 08:38:481543In addition to the refspec formats described in the OPTIONS
Junio C Hamanoba4b9282008-07-06 05:20:311544section, you can have a globbing refspec that looks like this:</p></div>
Junio C Hamanod3339982007-02-09 08:38:481545<div class="listingblock">
1546<div class="content">
1547<pre><tt>refs/heads/*:refs/remotes/origin/*</tt></pre>
1548</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591549<div class="paragraph"><p>A globbing refspec must have a non-empty RHS (i.e. must store
Junio C Hamano97bcb482010-11-25 03:16:071550what were fetched in remote-tracking branches), and its LHS and RHS
Junio C Hamanod3339982007-02-09 08:38:481551must end with <tt>/*</tt>. The above specifies that all remote
Junio C Hamano97bcb482010-11-25 03:16:071552branches are tracked using remote-tracking branches in
Junio C Hamanoba4b9282008-07-06 05:20:311553<tt>refs/remotes/origin/</tt> hierarchy under the same name.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591554<div class="paragraph"><p>The rule to determine which remote branch to merge after
Junio C Hamanod3339982007-02-09 08:38:481555fetching is a bit involved, in order not to break backward
Junio C Hamanoba4b9282008-07-06 05:20:311556compatibility.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591557<div class="paragraph"><p>If explicit refspecs were given on the command
Junio C Hamanoba4b9282008-07-06 05:20:311558line of <tt>git pull</tt>, they are all merged.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591559<div class="paragraph"><p>When no refspec was given on the command line, then <tt>git pull</tt>
Junio C Hamanod3339982007-02-09 08:38:481560uses the refspec from the configuration or
1561<tt>$GIT_DIR/remotes/&lt;origin&gt;</tt>. In such cases, the following
Junio C Hamanoba4b9282008-07-06 05:20:311562rules apply:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591563<div class="olist arabic"><ol class="arabic">
Junio C Hamanod3339982007-02-09 08:38:481564<li>
1565<p>
1566If <tt>branch.&lt;name&gt;.merge</tt> configuration for the current
1567 branch <tt>&lt;name&gt;</tt> exists, that is the name of the branch at the
1568 remote site that is merged.
1569</p>
1570</li>
1571<li>
1572<p>
1573If the refspec is a globbing one, nothing is merged.
1574</p>
1575</li>
1576<li>
1577<p>
1578Otherwise the remote branch of the first refspec is merged.
1579</p>
1580</li>
Junio C Hamanoba4b9282008-07-06 05:20:311581</ol></div>
Junio C Hamanod3339982007-02-09 08:38:481582</div>
Junio C Hamanoba4b9282008-07-06 05:20:311583<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231584<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591585<div class="ulist"><ul>
Junio C Hamano6d76d612008-05-09 05:46:081586<li>
Junio C Hamano1a4e8412005-12-27 08:17:231587<p>
Junio C Hamano6d76d612008-05-09 05:46:081588Update the remote-tracking branches for the repository
1589 you cloned from, then merge one of them into your
1590 current branch:
Junio C Hamano1a4e8412005-12-27 08:17:231591</p>
Junio C Hamano6d76d612008-05-09 05:46:081592<div class="listingblock">
1593<div class="content">
1594<pre><tt>$ git pull, git pull origin</tt></pre>
1595</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591596<div class="paragraph"><p>Normally the branch merged in is the HEAD of the remote repository,
Junio C Hamano6d76d612008-05-09 05:46:081597but the choice is determined by the branch.&lt;name&gt;.remote and
Junio C Hamanoa28a9202012-06-21 07:08:231598branch.&lt;name&gt;.merge options; see <a href="git-config.html">git-config(1)</a> for details.</p></div>
Junio C Hamano6d76d612008-05-09 05:46:081599</li>
1600<li>
Junio C Hamano1a4e8412005-12-27 08:17:231601<p>
Junio C Hamano6d76d612008-05-09 05:46:081602Merge into the current branch the remote branch <tt>next</tt>:
Junio C Hamano1a4e8412005-12-27 08:17:231603</p>
Junio C Hamano6d76d612008-05-09 05:46:081604<div class="listingblock">
1605<div class="content">
1606<pre><tt>$ git pull origin next</tt></pre>
1607</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591608<div class="paragraph"><p>This leaves a copy of <tt>next</tt> temporarily in FETCH_HEAD, but
Junio C Hamanoc21ab052009-10-31 04:03:551609does not update any remote-tracking branches. Using remote-tracking
1610branches, the same can be done by invoking fetch and merge:</p></div>
Junio C Hamano6d76d612008-05-09 05:46:081611<div class="listingblock">
1612<div class="content">
Junio C Hamanoc21ab052009-10-31 04:03:551613<pre><tt>$ git fetch origin
1614$ git merge origin/next</tt></pre>
Junio C Hamano6d76d612008-05-09 05:46:081615</div></div>
Junio C Hamano6d76d612008-05-09 05:46:081616</li>
Junio C Hamanoba4b9282008-07-06 05:20:311617</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591618<div class="paragraph"><p>If you tried a pull which resulted in a complex conflicts and
Junio C Hamano1aa40d22010-01-21 17:46:431619would want to start over, you can recover with <em>git reset</em>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231620</div>
Junio C Hamano5cd15182011-04-05 00:21:101621<h2 id="_bugs">BUGS</h2>
1622<div class="sectionbody">
1623<div class="paragraph"><p>Using --recurse-submodules can only fetch new commits in already checked
1624out submodules right now. When e.g. upstream added a new submodule in the
1625just fetched commits of the superproject the submodule itself can not be
1626fetched, making it impossible to check out that submodule later without
1627having to do a fetch again. This is expected to be fixed in a future git
1628version.</p></div>
1629</div>
Junio C Hamanoba4b9282008-07-06 05:20:311630<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231631<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231632<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>
Junio C Hamano1a4e8412005-12-27 08:17:231633</div>
Junio C Hamanoba4b9282008-07-06 05:20:311634<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231635<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231636<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231637</div>
Junio C Hamano7bd050f2011-09-22 06:32:221638</div>
1639<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:231640<div id="footer">
1641<div id="footer-text">
Junio C Hamanob76a6862012-05-02 22:02:461642Last updated 2012-05-02 15:00:44 PDT
Junio C Hamano1a4e8412005-12-27 08:17:231643</div>
1644</div>
1645</body>
1646</html>