"Fossies" - the Fresh Open Source Software Archive

Member "git-pull.html" (15 Dec 2018, 66610 Bytes) of package /linux/misc/git-htmldocs-2.20.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <?xml version="1.0" encoding="UTF-8"?>
    2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    3     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    5 <head>
    6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
    7 <meta name="generator" content="AsciiDoc 8.6.10" />
    8 <title>git-pull(1)</title>
    9 <style type="text/css">
   10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
   11 
   12 /* Default font. */
   13 body {
   14   font-family: Georgia,serif;
   15 }
   16 
   17 /* Title font. */
   18 h1, h2, h3, h4, h5, h6,
   19 div.title, caption.title,
   20 thead, p.table.header,
   21 #toctitle,
   22 #author, #revnumber, #revdate, #revremark,
   23 #footer {
   24   font-family: Arial,Helvetica,sans-serif;
   25 }
   26 
   27 body {
   28   margin: 1em 5% 1em 5%;
   29 }
   30 
   31 a {
   32   color: blue;
   33   text-decoration: underline;
   34 }
   35 a:visited {
   36   color: fuchsia;
   37 }
   38 
   39 em {
   40   font-style: italic;
   41   color: navy;
   42 }
   43 
   44 strong {
   45   font-weight: bold;
   46   color: #083194;
   47 }
   48 
   49 h1, h2, h3, h4, h5, h6 {
   50   color: #527bbd;
   51   margin-top: 1.2em;
   52   margin-bottom: 0.5em;
   53   line-height: 1.3;
   54 }
   55 
   56 h1, h2, h3 {
   57   border-bottom: 2px solid silver;
   58 }
   59 h2 {
   60   padding-top: 0.5em;
   61 }
   62 h3 {
   63   float: left;
   64 }
   65 h3 + * {
   66   clear: left;
   67 }
   68 h5 {
   69   font-size: 1.0em;
   70 }
   71 
   72 div.sectionbody {
   73   margin-left: 0;
   74 }
   75 
   76 hr {
   77   border: 1px solid silver;
   78 }
   79 
   80 p {
   81   margin-top: 0.5em;
   82   margin-bottom: 0.5em;
   83 }
   84 
   85 ul, ol, li > p {
   86   margin-top: 0;
   87 }
   88 ul > li     { color: #aaa; }
   89 ul > li > * { color: black; }
   90 
   91 .monospaced, code, pre {
   92   font-family: "Courier New", Courier, monospace;
   93   font-size: inherit;
   94   color: navy;
   95   padding: 0;
   96   margin: 0;
   97 }
   98 pre {
   99   white-space: pre-wrap;
  100 }
  101 
  102 #author {
  103   color: #527bbd;
  104   font-weight: bold;
  105   font-size: 1.1em;
  106 }
  107 #email {
  108 }
  109 #revnumber, #revdate, #revremark {
  110 }
  111 
  112 #footer {
  113   font-size: small;
  114   border-top: 2px solid silver;
  115   padding-top: 0.5em;
  116   margin-top: 4.0em;
  117 }
  118 #footer-text {
  119   float: left;
  120   padding-bottom: 0.5em;
  121 }
  122 #footer-badges {
  123   float: right;
  124   padding-bottom: 0.5em;
  125 }
  126 
  127 #preamble {
  128   margin-top: 1.5em;
  129   margin-bottom: 1.5em;
  130 }
  131 div.imageblock, div.exampleblock, div.verseblock,
  132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
  133 div.admonitionblock {
  134   margin-top: 1.0em;
  135   margin-bottom: 1.5em;
  136 }
  137 div.admonitionblock {
  138   margin-top: 2.0em;
  139   margin-bottom: 2.0em;
  140   margin-right: 10%;
  141   color: #606060;
  142 }
  143 
  144 div.content { /* Block element content. */
  145   padding: 0;
  146 }
  147 
  148 /* Block element titles. */
  149 div.title, caption.title {
  150   color: #527bbd;
  151   font-weight: bold;
  152   text-align: left;
  153   margin-top: 1.0em;
  154   margin-bottom: 0.5em;
  155 }
  156 div.title + * {
  157   margin-top: 0;
  158 }
  159 
  160 td div.title:first-child {
  161   margin-top: 0.0em;
  162 }
  163 div.content div.title:first-child {
  164   margin-top: 0.0em;
  165 }
  166 div.content + div.title {
  167   margin-top: 0.0em;
  168 }
  169 
  170 div.sidebarblock > div.content {
  171   background: #ffffee;
  172   border: 1px solid #dddddd;
  173   border-left: 4px solid #f0f0f0;
  174   padding: 0.5em;
  175 }
  176 
  177 div.listingblock > div.content {
  178   border: 1px solid #dddddd;
  179   border-left: 5px solid #f0f0f0;
  180   background: #f8f8f8;
  181   padding: 0.5em;
  182 }
  183 
  184 div.quoteblock, div.verseblock {
  185   padding-left: 1.0em;
  186   margin-left: 1.0em;
  187   margin-right: 10%;
  188   border-left: 5px solid #f0f0f0;
  189   color: #888;
  190 }
  191 
  192 div.quoteblock > div.attribution {
  193   padding-top: 0.5em;
  194   text-align: right;
  195 }
  196 
  197 div.verseblock > pre.content {
  198   font-family: inherit;
  199   font-size: inherit;
  200 }
  201 div.verseblock > div.attribution {
  202   padding-top: 0.75em;
  203   text-align: left;
  204 }
  205 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
  206 div.verseblock + div.attribution {
  207   text-align: left;
  208 }
  209 
  210 div.admonitionblock .icon {
  211   vertical-align: top;
  212   font-size: 1.1em;
  213   font-weight: bold;
  214   text-decoration: underline;
  215   color: #527bbd;
  216   padding-right: 0.5em;
  217 }
  218 div.admonitionblock td.content {
  219   padding-left: 0.5em;
  220   border-left: 3px solid #dddddd;
  221 }
  222 
  223 div.exampleblock > div.content {
  224   border-left: 3px solid #dddddd;
  225   padding-left: 0.5em;
  226 }
  227 
  228 div.imageblock div.content { padding-left: 0; }
  229 span.image img { border-style: none; vertical-align: text-bottom; }
  230 a.image:visited { color: white; }
  231 
  232 dl {
  233   margin-top: 0.8em;
  234   margin-bottom: 0.8em;
  235 }
  236 dt {
  237   margin-top: 0.5em;
  238   margin-bottom: 0;
  239   font-style: normal;
  240   color: navy;
  241 }
  242 dd > *:first-child {
  243   margin-top: 0.1em;
  244 }
  245 
  246 ul, ol {
  247     list-style-position: outside;
  248 }
  249 ol.arabic {
  250   list-style-type: decimal;
  251 }
  252 ol.loweralpha {
  253   list-style-type: lower-alpha;
  254 }
  255 ol.upperalpha {
  256   list-style-type: upper-alpha;
  257 }
  258 ol.lowerroman {
  259   list-style-type: lower-roman;
  260 }
  261 ol.upperroman {
  262   list-style-type: upper-roman;
  263 }
  264 
  265 div.compact ul, div.compact ol,
  266 div.compact p, div.compact p,
  267 div.compact div, div.compact div {
  268   margin-top: 0.1em;
  269   margin-bottom: 0.1em;
  270 }
  271 
  272 tfoot {
  273   font-weight: bold;
  274 }
  275 td > div.verse {
  276   white-space: pre;
  277 }
  278 
  279 div.hdlist {
  280   margin-top: 0.8em;
  281   margin-bottom: 0.8em;
  282 }
  283 div.hdlist tr {
  284   padding-bottom: 15px;
  285 }
  286 dt.hdlist1.strong, td.hdlist1.strong {
  287   font-weight: bold;
  288 }
  289 td.hdlist1 {
  290   vertical-align: top;
  291   font-style: normal;
  292   padding-right: 0.8em;
  293   color: navy;
  294 }
  295 td.hdlist2 {
  296   vertical-align: top;
  297 }
  298 div.hdlist.compact tr {
  299   margin: 0;
  300   padding-bottom: 0;
  301 }
  302 
  303 .comment {
  304   background: yellow;
  305 }
  306 
  307 .footnote, .footnoteref {
  308   font-size: 0.8em;
  309 }
  310 
  311 span.footnote, span.footnoteref {
  312   vertical-align: super;
  313 }
  314 
  315 #footnotes {
  316   margin: 20px 0 20px 0;
  317   padding: 7px 0 0 0;
  318 }
  319 
  320 #footnotes div.footnote {
  321   margin: 0 0 5px 0;
  322 }
  323 
  324 #footnotes hr {
  325   border: none;
  326   border-top: 1px solid silver;
  327   height: 1px;
  328   text-align: left;
  329   margin-left: 0;
  330   width: 20%;
  331   min-width: 100px;
  332 }
  333 
  334 div.colist td {
  335   padding-right: 0.5em;
  336   padding-bottom: 0.3em;
  337   vertical-align: top;
  338 }
  339 div.colist td img {
  340   margin-top: 0.3em;
  341 }
  342 
  343 @media print {
  344   #footer-badges { display: none; }
  345 }
  346 
  347 #toc {
  348   margin-bottom: 2.5em;
  349 }
  350 
  351 #toctitle {
  352   color: #527bbd;
  353   font-size: 1.1em;
  354   font-weight: bold;
  355   margin-top: 1.0em;
  356   margin-bottom: 0.1em;
  357 }
  358 
  359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
  360   margin-top: 0;
  361   margin-bottom: 0;
  362 }
  363 div.toclevel2 {
  364   margin-left: 2em;
  365   font-size: 0.9em;
  366 }
  367 div.toclevel3 {
  368   margin-left: 4em;
  369   font-size: 0.9em;
  370 }
  371 div.toclevel4 {
  372   margin-left: 6em;
  373   font-size: 0.9em;
  374 }
  375 
  376 span.aqua { color: aqua; }
  377 span.black { color: black; }
  378 span.blue { color: blue; }
  379 span.fuchsia { color: fuchsia; }
  380 span.gray { color: gray; }
  381 span.green { color: green; }
  382 span.lime { color: lime; }
  383 span.maroon { color: maroon; }
  384 span.navy { color: navy; }
  385 span.olive { color: olive; }
  386 span.purple { color: purple; }
  387 span.red { color: red; }
  388 span.silver { color: silver; }
  389 span.teal { color: teal; }
  390 span.white { color: white; }
  391 span.yellow { color: yellow; }
  392 
  393 span.aqua-background { background: aqua; }
  394 span.black-background { background: black; }
  395 span.blue-background { background: blue; }
  396 span.fuchsia-background { background: fuchsia; }
  397 span.gray-background { background: gray; }
  398 span.green-background { background: green; }
  399 span.lime-background { background: lime; }
  400 span.maroon-background { background: maroon; }
  401 span.navy-background { background: navy; }
  402 span.olive-background { background: olive; }
  403 span.purple-background { background: purple; }
  404 span.red-background { background: red; }
  405 span.silver-background { background: silver; }
  406 span.teal-background { background: teal; }
  407 span.white-background { background: white; }
  408 span.yellow-background { background: yellow; }
  409 
  410 span.big { font-size: 2em; }
  411 span.small { font-size: 0.6em; }
  412 
  413 span.underline { text-decoration: underline; }
  414 span.overline { text-decoration: overline; }
  415 span.line-through { text-decoration: line-through; }
  416 
  417 div.unbreakable { page-break-inside: avoid; }
  418 
  419 
  420 /*
  421  * xhtml11 specific
  422  *
  423  * */
  424 
  425 div.tableblock {
  426   margin-top: 1.0em;
  427   margin-bottom: 1.5em;
  428 }
  429 div.tableblock > table {
  430   border: 3px solid #527bbd;
  431 }
  432 thead, p.table.header {
  433   font-weight: bold;
  434   color: #527bbd;
  435 }
  436 p.table {
  437   margin-top: 0;
  438 }
  439 /* Because the table frame attribute is overriden by CSS in most browsers. */
  440 div.tableblock > table[frame="void"] {
  441   border-style: none;
  442 }
  443 div.tableblock > table[frame="hsides"] {
  444   border-left-style: none;
  445   border-right-style: none;
  446 }
  447 div.tableblock > table[frame="vsides"] {
  448   border-top-style: none;
  449   border-bottom-style: none;
  450 }
  451 
  452 
  453 /*
  454  * html5 specific
  455  *
  456  * */
  457 
  458 table.tableblock {
  459   margin-top: 1.0em;
  460   margin-bottom: 1.5em;
  461 }
  462 thead, p.tableblock.header {
  463   font-weight: bold;
  464   color: #527bbd;
  465 }
  466 p.tableblock {
  467   margin-top: 0;
  468 }
  469 table.tableblock {
  470   border-width: 3px;
  471   border-spacing: 0px;
  472   border-style: solid;
  473   border-color: #527bbd;
  474   border-collapse: collapse;
  475 }
  476 th.tableblock, td.tableblock {
  477   border-width: 1px;
  478   padding: 4px;
  479   border-style: solid;
  480   border-color: #527bbd;
  481 }
  482 
  483 table.tableblock.frame-topbot {
  484   border-left-style: hidden;
  485   border-right-style: hidden;
  486 }
  487 table.tableblock.frame-sides {
  488   border-top-style: hidden;
  489   border-bottom-style: hidden;
  490 }
  491 table.tableblock.frame-none {
  492   border-style: hidden;
  493 }
  494 
  495 th.tableblock.halign-left, td.tableblock.halign-left {
  496   text-align: left;
  497 }
  498 th.tableblock.halign-center, td.tableblock.halign-center {
  499   text-align: center;
  500 }
  501 th.tableblock.halign-right, td.tableblock.halign-right {
  502   text-align: right;
  503 }
  504 
  505 th.tableblock.valign-top, td.tableblock.valign-top {
  506   vertical-align: top;
  507 }
  508 th.tableblock.valign-middle, td.tableblock.valign-middle {
  509   vertical-align: middle;
  510 }
  511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
  512   vertical-align: bottom;
  513 }
  514 
  515 
  516 /*
  517  * manpage specific
  518  *
  519  * */
  520 
  521 body.manpage h1 {
  522   padding-top: 0.5em;
  523   padding-bottom: 0.5em;
  524   border-top: 2px solid silver;
  525   border-bottom: 2px solid silver;
  526 }
  527 body.manpage h2 {
  528   border-style: none;
  529 }
  530 body.manpage div.sectionbody {
  531   margin-left: 3em;
  532 }
  533 
  534 @media print {
  535   body.manpage div#toc { display: none; }
  536 }
  537 
  538 
  539 </style>
  540 <script type="text/javascript">
  541 /*<![CDATA[*/
  542 var asciidoc = {  // Namespace.
  543 
  544 /////////////////////////////////////////////////////////////////////
  545 // Table Of Contents generator
  546 /////////////////////////////////////////////////////////////////////
  547 
  548 /* Author: Mihai Bazon, September 2002
  549  * http://students.infoiasi.ro/~mishoo
  550  *
  551  * Table Of Content generator
  552  * Version: 0.4
  553  *
  554  * Feel free to use this script under the terms of the GNU General Public
  555  * License, as long as you do not remove or alter this notice.
  556  */
  557 
  558  /* modified by Troy D. Hanson, September 2006. License: GPL */
  559  /* modified by Stuart Rackham, 2006, 2009. License: GPL */
  560 
  561 // toclevels = 1..4.
  562 toc: function (toclevels) {
  563 
  564   function getText(el) {
  565     var text = "";
  566     for (var i = el.firstChild; i != null; i = i.nextSibling) {
  567       if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
  568         text += i.data;
  569       else if (i.firstChild != null)
  570         text += getText(i);
  571     }
  572     return text;
  573   }
  574 
  575   function TocEntry(el, text, toclevel) {
  576     this.element = el;
  577     this.text = text;
  578     this.toclevel = toclevel;
  579   }
  580 
  581   function tocEntries(el, toclevels) {
  582     var result = new Array;
  583     var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
  584     // Function that scans the DOM tree for header elements (the DOM2
  585     // nodeIterator API would be a better technique but not supported by all
  586     // browsers).
  587     var iterate = function (el) {
  588       for (var i = el.firstChild; i != null; i = i.nextSibling) {
  589         if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
  590           var mo = re.exec(i.tagName);
  591           if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
  592             result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
  593           }
  594           iterate(i);
  595         }
  596       }
  597     }
  598     iterate(el);
  599     return result;
  600   }
  601 
  602   var toc = document.getElementById("toc");
  603   if (!toc) {
  604     return;
  605   }
  606 
  607   // Delete existing TOC entries in case we're reloading the TOC.
  608   var tocEntriesToRemove = [];
  609   var i;
  610   for (i = 0; i < toc.childNodes.length; i++) {
  611     var entry = toc.childNodes[i];
  612     if (entry.nodeName.toLowerCase() == 'div'
  613      && entry.getAttribute("class")
  614      && entry.getAttribute("class").match(/^toclevel/))
  615       tocEntriesToRemove.push(entry);
  616   }
  617   for (i = 0; i < tocEntriesToRemove.length; i++) {
  618     toc.removeChild(tocEntriesToRemove[i]);
  619   }
  620 
  621   // Rebuild TOC entries.
  622   var entries = tocEntries(document.getElementById("content"), toclevels);
  623   for (var i = 0; i < entries.length; ++i) {
  624     var entry = entries[i];
  625     if (entry.element.id == "")
  626       entry.element.id = "_toc_" + i;
  627     var a = document.createElement("a");
  628     a.href = "#" + entry.element.id;
  629     a.appendChild(document.createTextNode(entry.text));
  630     var div = document.createElement("div");
  631     div.appendChild(a);
  632     div.className = "toclevel" + entry.toclevel;
  633     toc.appendChild(div);
  634   }
  635   if (entries.length == 0)
  636     toc.parentNode.removeChild(toc);
  637 },
  638 
  639 
  640 /////////////////////////////////////////////////////////////////////
  641 // Footnotes generator
  642 /////////////////////////////////////////////////////////////////////
  643 
  644 /* Based on footnote generation code from:
  645  * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
  646  */
  647 
  648 footnotes: function () {
  649   // Delete existing footnote entries in case we're reloading the footnodes.
  650   var i;
  651   var noteholder = document.getElementById("footnotes");
  652   if (!noteholder) {
  653     return;
  654   }
  655   var entriesToRemove = [];
  656   for (i = 0; i < noteholder.childNodes.length; i++) {
  657     var entry = noteholder.childNodes[i];
  658     if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
  659       entriesToRemove.push(entry);
  660   }
  661   for (i = 0; i < entriesToRemove.length; i++) {
  662     noteholder.removeChild(entriesToRemove[i]);
  663   }
  664 
  665   // Rebuild footnote entries.
  666   var cont = document.getElementById("content");
  667   var spans = cont.getElementsByTagName("span");
  668   var refs = {};
  669   var n = 0;
  670   for (i=0; i<spans.length; i++) {
  671     if (spans[i].className == "footnote") {
  672       n++;
  673       var note = spans[i].getAttribute("data-note");
  674       if (!note) {
  675         // Use [\s\S] in place of . so multi-line matches work.
  676         // Because JavaScript has no s (dotall) regex flag.
  677         note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
  678         spans[i].innerHTML =
  679           "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
  680           "' title='View footnote' class='footnote'>" + n + "</a>]";
  681         spans[i].setAttribute("data-note", note);
  682       }
  683       noteholder.innerHTML +=
  684         "<div class='footnote' id='_footnote_" + n + "'>" +
  685         "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
  686         n + "</a>. " + note + "</div>";
  687       var id =spans[i].getAttribute("id");
  688       if (id != null) refs["#"+id] = n;
  689     }
  690   }
  691   if (n == 0)
  692     noteholder.parentNode.removeChild(noteholder);
  693   else {
  694     // Process footnoterefs.
  695     for (i=0; i<spans.length; i++) {
  696       if (spans[i].className == "footnoteref") {
  697         var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
  698         href = href.match(/#.*/)[0];  // Because IE return full URL.
  699         n = refs[href];
  700         spans[i].innerHTML =
  701           "[<a href='#_footnote_" + n +
  702           "' title='View footnote' class='footnote'>" + n + "</a>]";
  703       }
  704     }
  705   }
  706 },
  707 
  708 install: function(toclevels) {
  709   var timerId;
  710 
  711   function reinstall() {
  712     asciidoc.footnotes();
  713     if (toclevels) {
  714       asciidoc.toc(toclevels);
  715     }
  716   }
  717 
  718   function reinstallAndRemoveTimer() {
  719     clearInterval(timerId);
  720     reinstall();
  721   }
  722 
  723   timerId = setInterval(reinstall, 500);
  724   if (document.addEventListener)
  725     document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
  726   else
  727     window.onload = reinstallAndRemoveTimer;
  728 }
  729 
  730 }
  731 asciidoc.install();
  732 /*]]>*/
  733 </script>
  734 </head>
  735 <body class="manpage">
  736 <div id="header">
  737 <h1>
  738 git-pull(1) Manual Page
  739 </h1>
  740 <h2>NAME</h2>
  741 <div class="sectionbody">
  742 <p>git-pull -
  743    Fetch from and integrate with another repository or a local branch
  744 </p>
  745 </div>
  746 </div>
  747 <div id="content">
  748 <div class="sect1">
  749 <h2 id="_synopsis">SYNOPSIS</h2>
  750 <div class="sectionbody">
  751 <div class="verseblock">
  752 <pre class="content"><em>git pull</em> [&lt;options&gt;] [&lt;repository&gt; [&lt;refspec&gt;&#8230;]]</pre>
  753 <div class="attribution">
  754 </div></div>
  755 </div>
  756 </div>
  757 <div class="sect1">
  758 <h2 id="_description">DESCRIPTION</h2>
  759 <div class="sectionbody">
  760 <div class="paragraph"><p>Incorporates changes from a remote repository into the current
  761 branch.  In its default mode, <code>git pull</code> is shorthand for
  762 <code>git fetch</code> followed by <code>git merge FETCH_HEAD</code>.</p></div>
  763 <div class="paragraph"><p>More precisely, <em>git pull</em> runs <em>git fetch</em> with the given
  764 parameters and calls <em>git merge</em> to merge the retrieved branch
  765 heads into the current branch.
  766 With <code>--rebase</code>, it runs <em>git rebase</em> instead of <em>git merge</em>.</p></div>
  767 <div class="paragraph"><p>&lt;repository&gt; should be the name of a remote repository as
  768 passed to <a href="git-fetch.html">git-fetch(1)</a>.  &lt;refspec&gt; can name an
  769 arbitrary remote ref (for example, the name of a tag) or even
  770 a collection of refs with corresponding remote-tracking branches
  771 (e.g., refs/heads/&#42;:refs/remotes/origin/&#42;),
  772 but usually it is the name of a branch in the remote repository.</p></div>
  773 <div class="paragraph"><p>Default values for &lt;repository&gt; and &lt;branch&gt; are read from the
  774 "remote" and "merge" configuration for the current branch
  775 as set by <a href="git-branch.html">git-branch(1)</a> <code>--track</code>.</p></div>
  776 <div class="paragraph"><p>Assume the following history exists and the current branch is
  777 "<code>master</code>":</p></div>
  778 <div class="listingblock">
  779 <div class="content">
  780 <pre><code>          A---B---C master on origin
  781          /
  782     D---E---F---G master
  783         ^
  784         origin/master in your repository</code></pre>
  785 </div></div>
  786 <div class="paragraph"><p>Then "<code>git pull</code>" will fetch and replay the changes from the remote
  787 <code>master</code> branch since it diverged from the local <code>master</code> (i.e., <code>E</code>)
  788 until its current commit (<code>C</code>) on top of <code>master</code> and record the
  789 result in a new commit along with the names of the two parent commits
  790 and a log message from the user describing the changes.</p></div>
  791 <div class="listingblock">
  792 <div class="content">
  793 <pre><code>          A---B---C origin/master
  794          /         \
  795     D---E---F---G---H master</code></pre>
  796 </div></div>
  797 <div class="paragraph"><p>See <a href="git-merge.html">git-merge(1)</a> for details, including how conflicts
  798 are presented and handled.</p></div>
  799 <div class="paragraph"><p>In Git 1.7.0 or later, to cancel a conflicting merge, use
  800 <code>git reset --merge</code>.  <strong>Warning</strong>: In older versions of Git, running <em>git pull</em>
  801 with uncommitted changes is discouraged: while possible, it leaves you
  802 in a state that may be hard to back out of in the case of a conflict.</p></div>
  803 <div class="paragraph"><p>If any of the remote changes overlap with local uncommitted changes,
  804 the merge will be automatically canceled and the work tree untouched.
  805 It is generally best to get any local changes in working order before
  806 pulling or stash them away with <a href="git-stash.html">git-stash(1)</a>.</p></div>
  807 </div>
  808 </div>
  809 <div class="sect1">
  810 <h2 id="_options">OPTIONS</h2>
  811 <div class="sectionbody">
  812 <div class="dlist"><dl>
  813 <dt class="hdlist1">
  814 -q
  815 </dt>
  816 <dt class="hdlist1">
  817 --quiet
  818 </dt>
  819 <dd>
  820 <p>
  821         This is passed to both underlying git-fetch to squelch reporting of
  822         during transfer, and underlying git-merge to squelch output during
  823         merging.
  824 </p>
  825 </dd>
  826 <dt class="hdlist1">
  827 -v
  828 </dt>
  829 <dt class="hdlist1">
  830 --verbose
  831 </dt>
  832 <dd>
  833 <p>
  834         Pass --verbose to git-fetch and git-merge.
  835 </p>
  836 </dd>
  837 <dt class="hdlist1">
  838 --[no-]recurse-submodules[=yes|on-demand|no]
  839 </dt>
  840 <dd>
  841 <p>
  842         This option controls if new commits of all populated submodules should
  843         be fetched and updated, too (see <a href="git-config.html">git-config(1)</a> and
  844         <a href="gitmodules.html">gitmodules(5)</a>).
  845 </p>
  846 <div class="paragraph"><p>If the checkout is done via rebase, local submodule commits are rebased as well.</p></div>
  847 <div class="paragraph"><p>If the update is done via merge, the submodule conflicts are resolved and checked out.</p></div>
  848 </dd>
  849 </dl></div>
  850 <div class="sect2">
  851 <h3 id="_options_related_to_merging">Options related to merging</h3>
  852 <div class="dlist"><dl>
  853 <dt class="hdlist1">
  854 --commit
  855 </dt>
  856 <dt class="hdlist1">
  857 --no-commit
  858 </dt>
  859 <dd>
  860 <p>
  861         Perform the merge and commit the result. This option can
  862         be used to override --no-commit.
  863 </p>
  864 <div class="paragraph"><p>With --no-commit perform the merge but pretend the merge
  865 failed and do not autocommit, to give the user a chance to
  866 inspect and further tweak the merge result before committing.</p></div>
  867 </dd>
  868 <dt class="hdlist1">
  869 --edit
  870 </dt>
  871 <dt class="hdlist1">
  872 -e
  873 </dt>
  874 <dt class="hdlist1">
  875 --no-edit
  876 </dt>
  877 <dd>
  878 <p>
  879         Invoke an editor before committing successful mechanical merge to
  880         further edit the auto-generated merge message, so that the user
  881         can explain and justify the merge. The <code>--no-edit</code> option can be
  882         used to accept the auto-generated message (this is generally
  883         discouraged).
  884 </p>
  885 <div class="paragraph"><p>Older scripts may depend on the historical behaviour of not allowing the
  886 user to edit the merge log message. They will see an editor opened when
  887 they run <code>git merge</code>. To make it easier to adjust such scripts to the
  888 updated behaviour, the environment variable <code>GIT_MERGE_AUTOEDIT</code> can be
  889 set to <code>no</code> at the beginning of them.</p></div>
  890 </dd>
  891 <dt class="hdlist1">
  892 --ff
  893 </dt>
  894 <dd>
  895 <p>
  896         When the merge resolves as a fast-forward, only update the branch
  897         pointer, without creating a merge commit.  This is the default
  898         behavior.
  899 </p>
  900 </dd>
  901 <dt class="hdlist1">
  902 --no-ff
  903 </dt>
  904 <dd>
  905 <p>
  906         Create a merge commit even when the merge resolves as a
  907         fast-forward.  This is the default behaviour when merging an
  908         annotated (and possibly signed) tag that is not stored in
  909         its natural place in <em>refs/tags/</em> hierarchy.
  910 </p>
  911 </dd>
  912 <dt class="hdlist1">
  913 --ff-only
  914 </dt>
  915 <dd>
  916 <p>
  917         Refuse to merge and exit with a non-zero status unless the
  918         current <code>HEAD</code> is already up to date or the merge can be
  919         resolved as a fast-forward.
  920 </p>
  921 </dd>
  922 <dt class="hdlist1">
  923 -S[&lt;keyid&gt;]
  924 </dt>
  925 <dt class="hdlist1">
  926 --gpg-sign[=&lt;keyid&gt;]
  927 </dt>
  928 <dd>
  929 <p>
  930         GPG-sign the resulting merge commit. The <code>keyid</code> argument is
  931         optional and defaults to the committer identity; if specified,
  932         it must be stuck to the option without a space.
  933 </p>
  934 </dd>
  935 <dt class="hdlist1">
  936 --log[=&lt;n&gt;]
  937 </dt>
  938 <dt class="hdlist1">
  939 --no-log
  940 </dt>
  941 <dd>
  942 <p>
  943         In addition to branch names, populate the log message with
  944         one-line descriptions from at most &lt;n&gt; actual commits that are being
  945         merged. See also <a href="git-fmt-merge-msg.html">git-fmt-merge-msg(1)</a>.
  946 </p>
  947 <div class="paragraph"><p>With --no-log do not list one-line descriptions from the
  948 actual commits being merged.</p></div>
  949 </dd>
  950 <dt class="hdlist1">
  951 --signoff
  952 </dt>
  953 <dt class="hdlist1">
  954 --no-signoff
  955 </dt>
  956 <dd>
  957 <p>
  958         Add Signed-off-by line by the committer at the end of the commit
  959         log message.  The meaning of a signoff depends on the project,
  960         but it typically certifies that committer has
  961         the rights to submit this work under the same license and
  962         agrees to a Developer Certificate of Origin
  963         (see <a href="http://developercertificate.org/">http://developercertificate.org/</a> for more information).
  964 </p>
  965 <div class="paragraph"><p>With --no-signoff do not add a Signed-off-by line.</p></div>
  966 </dd>
  967 <dt class="hdlist1">
  968 --stat
  969 </dt>
  970 <dt class="hdlist1">
  971 -n
  972 </dt>
  973 <dt class="hdlist1">
  974 --no-stat
  975 </dt>
  976 <dd>
  977 <p>
  978         Show a diffstat at the end of the merge. The diffstat is also
  979         controlled by the configuration option merge.stat.
  980 </p>
  981 <div class="paragraph"><p>With -n or --no-stat do not show a diffstat at the end of the
  982 merge.</p></div>
  983 </dd>
  984 <dt class="hdlist1">
  985 --squash
  986 </dt>
  987 <dt class="hdlist1">
  988 --no-squash
  989 </dt>
  990 <dd>
  991 <p>
  992         Produce the working tree and index state as if a real merge
  993         happened (except for the merge information), but do not actually
  994         make a commit, move the <code>HEAD</code>, or record <code>$GIT_DIR/MERGE_HEAD</code>
  995         (to cause the next <code>git commit</code> command to create a merge
  996         commit).  This allows you to create a single commit on top of
  997         the current branch whose effect is the same as merging another
  998         branch (or more in case of an octopus).
  999 </p>
 1000 <div class="paragraph"><p>With --no-squash perform the merge and commit the result. This
 1001 option can be used to override --squash.</p></div>
 1002 </dd>
 1003 <dt class="hdlist1">
 1004 -s &lt;strategy&gt;
 1005 </dt>
 1006 <dt class="hdlist1">
 1007 --strategy=&lt;strategy&gt;
 1008 </dt>
 1009 <dd>
 1010 <p>
 1011         Use the given merge strategy; can be supplied more than
 1012         once to specify them in the order they should be tried.
 1013         If there is no <code>-s</code> option, a built-in list of strategies
 1014         is used instead (<em>git merge-recursive</em> when merging a single
 1015         head, <em>git merge-octopus</em> otherwise).
 1016 </p>
 1017 </dd>
 1018 <dt class="hdlist1">
 1019 -X &lt;option&gt;
 1020 </dt>
 1021 <dt class="hdlist1">
 1022 --strategy-option=&lt;option&gt;
 1023 </dt>
 1024 <dd>
 1025 <p>
 1026         Pass merge strategy specific option through to the merge
 1027         strategy.
 1028 </p>
 1029 </dd>
 1030 <dt class="hdlist1">
 1031 --verify-signatures
 1032 </dt>
 1033 <dt class="hdlist1">
 1034 --no-verify-signatures
 1035 </dt>
 1036 <dd>
 1037 <p>
 1038         Verify that the tip commit of the side branch being merged is
 1039         signed with a valid key, i.e. a key that has a valid uid: in the
 1040         default trust model, this means the signing key has been signed by
 1041         a trusted key.  If the tip commit of the side branch is not signed
 1042         with a valid key, the merge is aborted.
 1043 </p>
 1044 </dd>
 1045 <dt class="hdlist1">
 1046 --summary
 1047 </dt>
 1048 <dt class="hdlist1">
 1049 --no-summary
 1050 </dt>
 1051 <dd>
 1052 <p>
 1053         Synonyms to --stat and --no-stat; these are deprecated and will be
 1054         removed in the future.
 1055 </p>
 1056 </dd>
 1057 <dt class="hdlist1">
 1058 --allow-unrelated-histories
 1059 </dt>
 1060 <dd>
 1061 <p>
 1062         By default, <code>git merge</code> command refuses to merge histories
 1063         that do not share a common ancestor.  This option can be
 1064         used to override this safety when merging histories of two
 1065         projects that started their lives independently. As that is
 1066         a very rare occasion, no configuration variable to enable
 1067         this by default exists and will not be added.
 1068 </p>
 1069 </dd>
 1070 <dt class="hdlist1">
 1071 -r
 1072 </dt>
 1073 <dt class="hdlist1">
 1074 --rebase[=false|true|merges|preserve|interactive]
 1075 </dt>
 1076 <dd>
 1077 <p>
 1078         When true, rebase the current branch on top of the upstream
 1079         branch after fetching. If there is a remote-tracking branch
 1080         corresponding to the upstream branch and the upstream branch
 1081         was rebased since last fetched, the rebase uses that information
 1082         to avoid rebasing non-local changes.
 1083 </p>
 1084 <div class="paragraph"><p>When set to <code>merges</code>, rebase using <code>git rebase --rebase-merges</code> so that
 1085 the local merge commits are included in the rebase (see
 1086 <a href="git-rebase.html">git-rebase(1)</a> for details).</p></div>
 1087 <div class="paragraph"><p>When set to preserve, rebase with the <code>--preserve-merges</code> option passed
 1088 to <code>git rebase</code> so that locally created merge commits will not be flattened.</p></div>
 1089 <div class="paragraph"><p>When false, merge the current branch into the upstream branch.</p></div>
 1090 <div class="paragraph"><p>When <code>interactive</code>, enable the interactive mode of rebase.</p></div>
 1091 <div class="paragraph"><p>See <code>pull.rebase</code>, <code>branch.&lt;name&gt;.rebase</code> and <code>branch.autoSetupRebase</code> in
 1092 <a href="git-config.html">git-config(1)</a> if you want to make <code>git pull</code> always use
 1093 <code>--rebase</code> instead of merging.</p></div>
 1094 <div class="admonitionblock">
 1095 <table><tr>
 1096 <td class="icon">
 1097 <div class="title">Note</div>
 1098 </td>
 1099 <td class="content">This is a potentially <em>dangerous</em> mode of operation.
 1100 It rewrites history, which does not bode well when you
 1101 published that history already.  Do <strong>not</strong> use this option
 1102 unless you have read <a href="git-rebase.html">git-rebase(1)</a> carefully.</td>
 1103 </tr></table>
 1104 </div>
 1105 </dd>
 1106 <dt class="hdlist1">
 1107 --no-rebase
 1108 </dt>
 1109 <dd>
 1110 <p>
 1111         Override earlier --rebase.
 1112 </p>
 1113 </dd>
 1114 <dt class="hdlist1">
 1115 --autostash
 1116 </dt>
 1117 <dt class="hdlist1">
 1118 --no-autostash
 1119 </dt>
 1120 <dd>
 1121 <p>
 1122         Before starting rebase, stash local modifications away (see
 1123         <a href="git-stash.html">git-stash(1)</a>) if needed, and apply the stash entry when
 1124         done. <code>--no-autostash</code> is useful to override the <code>rebase.autoStash</code>
 1125         configuration variable (see <a href="git-config.html">git-config(1)</a>).
 1126 </p>
 1127 <div class="paragraph"><p>This option is only valid when "--rebase" is used.</p></div>
 1128 </dd>
 1129 </dl></div>
 1130 </div>
 1131 <div class="sect2">
 1132 <h3 id="_options_related_to_fetching">Options related to fetching</h3>
 1133 <div class="dlist"><dl>
 1134 <dt class="hdlist1">
 1135 --all
 1136 </dt>
 1137 <dd>
 1138 <p>
 1139         Fetch all remotes.
 1140 </p>
 1141 </dd>
 1142 <dt class="hdlist1">
 1143 -a
 1144 </dt>
 1145 <dt class="hdlist1">
 1146 --append
 1147 </dt>
 1148 <dd>
 1149 <p>
 1150         Append ref names and object names of fetched refs to the
 1151         existing contents of <code>.git/FETCH_HEAD</code>.  Without this
 1152         option old data in <code>.git/FETCH_HEAD</code> will be overwritten.
 1153 </p>
 1154 </dd>
 1155 <dt class="hdlist1">
 1156 --depth=&lt;depth&gt;
 1157 </dt>
 1158 <dd>
 1159 <p>
 1160         Limit fetching to the specified number of commits from the tip of
 1161         each remote branch history. If fetching to a <em>shallow</em> repository
 1162         created by <code>git clone</code> with <code>--depth=&lt;depth&gt;</code> option (see
 1163         <a href="git-clone.html">git-clone(1)</a>), deepen or shorten the history to the specified
 1164         number of commits. Tags for the deepened commits are not fetched.
 1165 </p>
 1166 </dd>
 1167 <dt class="hdlist1">
 1168 --deepen=&lt;depth&gt;
 1169 </dt>
 1170 <dd>
 1171 <p>
 1172         Similar to --depth, except it specifies the number of commits
 1173         from the current shallow boundary instead of from the tip of
 1174         each remote branch history.
 1175 </p>
 1176 </dd>
 1177 <dt class="hdlist1">
 1178 --shallow-since=&lt;date&gt;
 1179 </dt>
 1180 <dd>
 1181 <p>
 1182         Deepen or shorten the history of a shallow repository to
 1183         include all reachable commits after &lt;date&gt;.
 1184 </p>
 1185 </dd>
 1186 <dt class="hdlist1">
 1187 --shallow-exclude=&lt;revision&gt;
 1188 </dt>
 1189 <dd>
 1190 <p>
 1191         Deepen or shorten the history of a shallow repository to
 1192         exclude commits reachable from a specified remote branch or tag.
 1193         This option can be specified multiple times.
 1194 </p>
 1195 </dd>
 1196 <dt class="hdlist1">
 1197 --unshallow
 1198 </dt>
 1199 <dd>
 1200 <p>
 1201         If the source repository is complete, convert a shallow
 1202         repository to a complete one, removing all the limitations
 1203         imposed by shallow repositories.
 1204 </p>
 1205 <div class="paragraph"><p>If the source repository is shallow, fetch as much as possible so that
 1206 the current repository has the same history as the source repository.</p></div>
 1207 </dd>
 1208 <dt class="hdlist1">
 1209 --update-shallow
 1210 </dt>
 1211 <dd>
 1212 <p>
 1213         By default when fetching from a shallow repository,
 1214         <code>git fetch</code> refuses refs that require updating
 1215         .git/shallow. This option updates .git/shallow and accept such
 1216         refs.
 1217 </p>
 1218 </dd>
 1219 <dt class="hdlist1">
 1220 --negotiation-tip=&lt;commit|glob&gt;
 1221 </dt>
 1222 <dd>
 1223 <p>
 1224         By default, Git will report, to the server, commits reachable
 1225         from all local refs to find common commits in an attempt to
 1226         reduce the size of the to-be-received packfile. If specified,
 1227         Git will only report commits reachable from the given tips.
 1228         This is useful to speed up fetches when the user knows which
 1229         local ref is likely to have commits in common with the
 1230         upstream ref being fetched.
 1231 </p>
 1232 <div class="paragraph"><p>This option may be specified more than once; if so, Git will report
 1233 commits reachable from any of the given commits.</p></div>
 1234 <div class="paragraph"><p>The argument to this option may be a glob on ref names, a ref, or the (possibly
 1235 abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying
 1236 this option multiple times, one for each matching ref name.</p></div>
 1237 <div class="paragraph"><p>See also the <code>fetch.negotiationAlgorithm</code> configuration variable
 1238 documented in <a href="git-config.html">git-config(1)</a>.</p></div>
 1239 </dd>
 1240 <dt class="hdlist1">
 1241 -f
 1242 </dt>
 1243 <dt class="hdlist1">
 1244 --force
 1245 </dt>
 1246 <dd>
 1247 <p>
 1248         When <em>git fetch</em> is used with <code>&lt;src&gt;:&lt;dst&gt;</code> refspec it may
 1249         refuse to update the local branch as discussed
 1250         in the <code>&lt;refspec&gt;</code> part of the <a href="git-fetch.html">git-fetch(1)</a>
 1251         documentation.
 1252         This option overrides that check.
 1253 </p>
 1254 </dd>
 1255 <dt class="hdlist1">
 1256 -k
 1257 </dt>
 1258 <dt class="hdlist1">
 1259 --keep
 1260 </dt>
 1261 <dd>
 1262 <p>
 1263         Keep downloaded pack.
 1264 </p>
 1265 </dd>
 1266 <dt class="hdlist1">
 1267 --no-tags
 1268 </dt>
 1269 <dd>
 1270 <p>
 1271         By default, tags that point at objects that are downloaded
 1272         from the remote repository are fetched and stored locally.
 1273         This option disables this automatic tag following. The default
 1274         behavior for a remote may be specified with the remote.&lt;name&gt;.tagOpt
 1275         setting. See <a href="git-config.html">git-config(1)</a>.
 1276 </p>
 1277 </dd>
 1278 <dt class="hdlist1">
 1279 -u
 1280 </dt>
 1281 <dt class="hdlist1">
 1282 --update-head-ok
 1283 </dt>
 1284 <dd>
 1285 <p>
 1286         By default <em>git fetch</em> refuses to update the head which
 1287         corresponds to the current branch.  This flag disables the
 1288         check.  This is purely for the internal use for <em>git pull</em>
 1289         to communicate with <em>git fetch</em>, and unless you are
 1290         implementing your own Porcelain you are not supposed to
 1291         use it.
 1292 </p>
 1293 </dd>
 1294 <dt class="hdlist1">
 1295 --upload-pack &lt;upload-pack&gt;
 1296 </dt>
 1297 <dd>
 1298 <p>
 1299         When given, and the repository to fetch from is handled
 1300         by <em>git fetch-pack</em>, <code>--exec=&lt;upload-pack&gt;</code> is passed to
 1301         the command to specify non-default path for the command
 1302         run on the other end.
 1303 </p>
 1304 </dd>
 1305 <dt class="hdlist1">
 1306 --progress
 1307 </dt>
 1308 <dd>
 1309 <p>
 1310         Progress status is reported on the standard error stream
 1311         by default when it is attached to a terminal, unless -q
 1312         is specified. This flag forces progress status even if the
 1313         standard error stream is not directed to a terminal.
 1314 </p>
 1315 </dd>
 1316 <dt class="hdlist1">
 1317 -o &lt;option&gt;
 1318 </dt>
 1319 <dt class="hdlist1">
 1320 --server-option=&lt;option&gt;
 1321 </dt>
 1322 <dd>
 1323 <p>
 1324         Transmit the given string to the server when communicating using
 1325         protocol version 2.  The given string must not contain a NUL or LF
 1326         character.
 1327         When multiple <code>--server-option=&lt;option&gt;</code> are given, they are all
 1328         sent to the other side in the order listed on the command line.
 1329 </p>
 1330 </dd>
 1331 <dt class="hdlist1">
 1332 -4
 1333 </dt>
 1334 <dt class="hdlist1">
 1335 --ipv4
 1336 </dt>
 1337 <dd>
 1338 <p>
 1339         Use IPv4 addresses only, ignoring IPv6 addresses.
 1340 </p>
 1341 </dd>
 1342 <dt class="hdlist1">
 1343 -6
 1344 </dt>
 1345 <dt class="hdlist1">
 1346 --ipv6
 1347 </dt>
 1348 <dd>
 1349 <p>
 1350         Use IPv6 addresses only, ignoring IPv4 addresses.
 1351 </p>
 1352 </dd>
 1353 <dt class="hdlist1">
 1354 &lt;repository&gt;
 1355 </dt>
 1356 <dd>
 1357 <p>
 1358         The "remote" repository that is the source of a fetch
 1359         or pull operation.  This parameter can be either a URL
 1360         (see the section <a href="#URLS">GIT URLS</a> below) or the name
 1361         of a remote (see the section <a href="#REMOTES">REMOTES</a> below).
 1362 </p>
 1363 </dd>
 1364 <dt class="hdlist1">
 1365 &lt;refspec&gt;
 1366 </dt>
 1367 <dd>
 1368 <p>
 1369         Specifies which refs to fetch and which local refs to update.
 1370         When no &lt;refspec&gt;s appear on the command line, the refs to fetch
 1371         are read from <code>remote.&lt;repository&gt;.fetch</code> variables instead
 1372         (see <a href="git-fetch.html">git-fetch(1)</a>).
 1373 </p>
 1374 <div class="paragraph"><p>The format of a &lt;refspec&gt; parameter is an optional plus
 1375 <code>+</code>, followed by the source &lt;src&gt;, followed
 1376 by a colon <code>:</code>, followed by the destination ref &lt;dst&gt;.
 1377 The colon can be omitted when &lt;dst&gt; is empty.  &lt;src&gt; is
 1378 typically a ref, but it can also be a fully spelled hex object
 1379 name.</p></div>
 1380 <div class="paragraph"><p><code>tag &lt;tag&gt;</code> means the same as <code>refs/tags/&lt;tag&gt;:refs/tags/&lt;tag&gt;</code>;
 1381 it requests fetching everything up to the given tag.</p></div>
 1382 <div class="paragraph"><p>The remote ref that matches &lt;src&gt;
 1383 is fetched, and if &lt;dst&gt; is not an empty string, an attempt
 1384 is made to update the local ref that matches it.</p></div>
 1385 <div class="paragraph"><p>Whether that update is allowed without <code>--force</code> depends on the ref
 1386 namespace it&#8217;s being fetched to, the type of object being fetched, and
 1387 whether the update is considered to be a fast-forward. Generally, the
 1388 same rules apply for fetching as when pushing, see the <code>&lt;refspec&gt;...</code>
 1389 section of <a href="git-push.html">git-push(1)</a> for what those are. Exceptions to those
 1390 rules particular to <em>git fetch</em> are noted below.</p></div>
 1391 <div class="paragraph"><p>Until Git version 2.20, and unlike when pushing with
 1392 <a href="git-push.html">git-push(1)</a>, any updates to <code>refs/tags/*</code> would be accepted
 1393 without <code>+</code> in the refspec (or <code>--force</code>). When fetching, we promiscuously
 1394 considered all tag updates from a remote to be forced fetches.  Since
 1395 Git version 2.20, fetching to update <code>refs/tags/*</code> works the same way
 1396 as when pushing. I.e. any updates will be rejected without <code>+</code> in the
 1397 refspec (or <code>--force</code>).</p></div>
 1398 <div class="paragraph"><p>Unlike when pushing with <a href="git-push.html">git-push(1)</a>, any updates outside of
 1399 <code>refs/{tags,heads}/*</code> will be accepted without <code>+</code> in the refspec (or
 1400 <code>--force</code>), whether that&#8217;s swapping e.g. a tree object for a blob, or
 1401 a commit for another commit that&#8217;s doesn&#8217;t have the previous commit as
 1402 an ancestor etc.</p></div>
 1403 <div class="paragraph"><p>Unlike when pushing with <a href="git-push.html">git-push(1)</a>, there is no
 1404 configuration which&#8217;ll amend these rules, and nothing like a
 1405 <code>pre-fetch</code> hook analogous to the <code>pre-receive</code> hook.</p></div>
 1406 <div class="paragraph"><p>As with pushing with <a href="git-push.html">git-push(1)</a>, all of the rules described
 1407 above about what&#8217;s not allowed as an update can be overridden by
 1408 adding an the optional leading <code>+</code> to a refspec (or using <code>--force</code>
 1409 command line option). The only exception to this is that no amount of
 1410 forcing will make the <code>refs/heads/*</code> namespace accept a non-commit
 1411 object.</p></div>
 1412 <div class="admonitionblock">
 1413 <table><tr>
 1414 <td class="icon">
 1415 <div class="title">Note</div>
 1416 </td>
 1417 <td class="content">When the remote branch you want to fetch is known to
 1418 be rewound and rebased regularly, it is expected that
 1419 its new tip will not be descendant of its previous tip
 1420 (as stored in your remote-tracking branch the last time
 1421 you fetched).  You would want
 1422 to use the <code>+</code> sign to indicate non-fast-forward updates
 1423 will be needed for such branches.  There is no way to
 1424 determine or declare that a branch will be made available
 1425 in a repository with this behavior; the pulling user simply
 1426 must know this is the expected usage pattern for a branch.</td>
 1427 </tr></table>
 1428 </div>
 1429 <div class="admonitionblock">
 1430 <table><tr>
 1431 <td class="icon">
 1432 <div class="title">Note</div>
 1433 </td>
 1434 <td class="content">There is a difference between listing multiple &lt;refspec&gt;
 1435 directly on <em>git pull</em> command line and having multiple
 1436 <code>remote.&lt;repository&gt;.fetch</code> entries in your configuration
 1437 for a &lt;repository&gt; and running a
 1438 <em>git pull</em> command without any explicit &lt;refspec&gt; parameters.
 1439 &lt;refspec&gt;s listed explicitly on the command line are always
 1440 merged into the current branch after fetching.  In other words,
 1441 if you list more than one remote ref, <em>git pull</em> will create
 1442 an Octopus merge.  On the other hand, if you do not list any
 1443 explicit &lt;refspec&gt; parameter on the command line, <em>git pull</em>
 1444 will fetch all the &lt;refspec&gt;s it finds in the
 1445 <code>remote.&lt;repository&gt;.fetch</code> configuration and merge
 1446 only the first &lt;refspec&gt; found into the current branch.
 1447 This is because making an
 1448 Octopus from remote refs is rarely done, while keeping track
 1449 of multiple remote heads in one-go by fetching more than one
 1450 is often useful.</td>
 1451 </tr></table>
 1452 </div>
 1453 </dd>
 1454 </dl></div>
 1455 </div>
 1456 </div>
 1457 </div>
 1458 <div class="sect1">
 1459 <h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2>
 1460 <div class="sectionbody">
 1461 <div class="paragraph"><p>In general, URLs contain information about the transport protocol, the
 1462 address of the remote server, and the path to the repository.
 1463 Depending on the transport protocol, some of this information may be
 1464 absent.</p></div>
 1465 <div class="paragraph"><p>Git supports ssh, git, http, and https protocols (in addition, ftp,
 1466 and ftps can be used for fetching, but this is inefficient and
 1467 deprecated; do not use it).</p></div>
 1468 <div class="paragraph"><p>The native transport (i.e. git:// URL) does no authentication and
 1469 should be used with caution on unsecured networks.</p></div>
 1470 <div class="paragraph"><p>The following syntaxes may be used with them:</p></div>
 1471 <div class="ulist"><ul>
 1472 <li>
 1473 <p>
 1474 ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
 1475 </p>
 1476 </li>
 1477 <li>
 1478 <p>
 1479 git://host.xz&#91;:port&#93;/path/to/repo.git/
 1480 </p>
 1481 </li>
 1482 <li>
 1483 <p>
 1484 http&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
 1485 </p>
 1486 </li>
 1487 <li>
 1488 <p>
 1489 ftp&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
 1490 </p>
 1491 </li>
 1492 </ul></div>
 1493 <div class="paragraph"><p>An alternative scp-like syntax may also be used with the ssh protocol:</p></div>
 1494 <div class="ulist"><ul>
 1495 <li>
 1496 <p>
 1497 &#91;user@&#93;host.xz:path/to/repo.git/
 1498 </p>
 1499 </li>
 1500 </ul></div>
 1501 <div class="paragraph"><p>This syntax is only recognized if there are no slashes before the
 1502 first colon. This helps differentiate a local path that contains a
 1503 colon. For example the local path <code>foo:bar</code> could be specified as an
 1504 absolute path or <code>./foo:bar</code> to avoid being misinterpreted as an ssh
 1505 url.</p></div>
 1506 <div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
 1507 <div class="ulist"><ul>
 1508 <li>
 1509 <p>
 1510 ssh://&#91;user@&#93;host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
 1511 </p>
 1512 </li>
 1513 <li>
 1514 <p>
 1515 git://host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
 1516 </p>
 1517 </li>
 1518 <li>
 1519 <p>
 1520 &#91;user@&#93;host.xz:/~&#91;user&#93;/path/to/repo.git/
 1521 </p>
 1522 </li>
 1523 </ul></div>
 1524 <div class="paragraph"><p>For local repositories, also supported by Git natively, the following
 1525 syntaxes may be used:</p></div>
 1526 <div class="ulist"><ul>
 1527 <li>
 1528 <p>
 1529 /path/to/repo.git/
 1530 </p>
 1531 </li>
 1532 <li>
 1533 <p>
 1534 file:///path/to/repo.git/
 1535 </p>
 1536 </li>
 1537 </ul></div>
 1538 <div class="paragraph"><p>These two syntaxes are mostly equivalent, except when cloning, when
 1539 the former implies --local option. See <a href="git-clone.html">git-clone(1)</a> for
 1540 details.</p></div>
 1541 <div class="paragraph"><p>When Git doesn&#8217;t know how to handle a certain transport protocol, it
 1542 attempts to use the <em>remote-&lt;transport&gt;</em> remote helper, if one
 1543 exists. To explicitly request a remote helper, the following syntax
 1544 may be used:</p></div>
 1545 <div class="ulist"><ul>
 1546 <li>
 1547 <p>
 1548 &lt;transport&gt;::&lt;address&gt;
 1549 </p>
 1550 </li>
 1551 </ul></div>
 1552 <div class="paragraph"><p>where &lt;address&gt; may be a path, a server and path, or an arbitrary
 1553 URL-like string recognized by the specific remote helper being
 1554 invoked. See <a href="gitremote-helpers.html">gitremote-helpers(1)</a> for details.</p></div>
 1555 <div class="paragraph"><p>If there are a large number of similarly-named remote repositories and
 1556 you want to use a different format for them (such that the URLs you
 1557 use will be rewritten into URLs that work), you can create a
 1558 configuration section of the form:</p></div>
 1559 <div class="listingblock">
 1560 <div class="content">
 1561 <pre><code>        [url "&lt;actual url base&gt;"]
 1562                 insteadOf = &lt;other url base&gt;</code></pre>
 1563 </div></div>
 1564 <div class="paragraph"><p>For example, with this:</p></div>
 1565 <div class="listingblock">
 1566 <div class="content">
 1567 <pre><code>        [url "git://git.host.xz/"]
 1568                 insteadOf = host.xz:/path/to/
 1569                 insteadOf = work:</code></pre>
 1570 </div></div>
 1571 <div class="paragraph"><p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
 1572 rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
 1573 <div class="paragraph"><p>If you want to rewrite URLs for push only, you can create a
 1574 configuration section of the form:</p></div>
 1575 <div class="listingblock">
 1576 <div class="content">
 1577 <pre><code>        [url "&lt;actual url base&gt;"]
 1578                 pushInsteadOf = &lt;other url base&gt;</code></pre>
 1579 </div></div>
 1580 <div class="paragraph"><p>For example, with this:</p></div>
 1581 <div class="listingblock">
 1582 <div class="content">
 1583 <pre><code>        [url "ssh://example.org/"]
 1584                 pushInsteadOf = git://example.org/</code></pre>
 1585 </div></div>
 1586 <div class="paragraph"><p>a URL like "git://example.org/path/to/repo.git" will be rewritten to
 1587 "ssh://example.org/path/to/repo.git" for pushes, but pulls will still
 1588 use the original URL.</p></div>
 1589 </div>
 1590 </div>
 1591 <div class="sect1">
 1592 <h2 id="_remotes_a_id_remotes_a">REMOTES<a id="REMOTES"></a></h2>
 1593 <div class="sectionbody">
 1594 <div class="paragraph"><p>The name of one of the following can be used instead
 1595 of a URL as <code>&lt;repository&gt;</code> argument:</p></div>
 1596 <div class="ulist"><ul>
 1597 <li>
 1598 <p>
 1599 a remote in the Git configuration file: <code>$GIT_DIR/config</code>,
 1600 </p>
 1601 </li>
 1602 <li>
 1603 <p>
 1604 a file in the <code>$GIT_DIR/remotes</code> directory, or
 1605 </p>
 1606 </li>
 1607 <li>
 1608 <p>
 1609 a file in the <code>$GIT_DIR/branches</code> directory.
 1610 </p>
 1611 </li>
 1612 </ul></div>
 1613 <div class="paragraph"><p>All of these also allow you to omit the refspec from the command line
 1614 because they each contain a refspec which git will use by default.</p></div>
 1615 <div class="sect2">
 1616 <h3 id="_named_remote_in_configuration_file">Named remote in configuration file</h3>
 1617 <div class="paragraph"><p>You can choose to provide the name of a remote which you had previously
 1618 configured using <a href="git-remote.html">git-remote(1)</a>, <a href="git-config.html">git-config(1)</a>
 1619 or even by a manual edit to the <code>$GIT_DIR/config</code> file.  The URL of
 1620 this remote will be used to access the repository.  The refspec
 1621 of this remote will be used by default when you do
 1622 not provide a refspec on the command line.  The entry in the
 1623 config file would appear like this:</p></div>
 1624 <div class="listingblock">
 1625 <div class="content">
 1626 <pre><code>        [remote "&lt;name&gt;"]
 1627                 url = &lt;url&gt;
 1628                 pushurl = &lt;pushurl&gt;
 1629                 push = &lt;refspec&gt;
 1630                 fetch = &lt;refspec&gt;</code></pre>
 1631 </div></div>
 1632 <div class="paragraph"><p>The <code>&lt;pushurl&gt;</code> is used for pushes only. It is optional and defaults
 1633 to <code>&lt;url&gt;</code>.</p></div>
 1634 </div>
 1635 <div class="sect2">
 1636 <h3 id="_named_file_in_code_git_dir_remotes_code">Named file in <code>$GIT_DIR/remotes</code></h3>
 1637 <div class="paragraph"><p>You can choose to provide the name of a
 1638 file in <code>$GIT_DIR/remotes</code>.  The URL
 1639 in this file will be used to access the repository.  The refspec
 1640 in this file will be used as default when you do not
 1641 provide a refspec on the command line.  This file should have the
 1642 following format:</p></div>
 1643 <div class="listingblock">
 1644 <div class="content">
 1645 <pre><code>        URL: one of the above URL format
 1646         Push: &lt;refspec&gt;
 1647         Pull: &lt;refspec&gt;</code></pre>
 1648 </div></div>
 1649 <div class="paragraph"><p><code>Push:</code> lines are used by <em>git push</em> and
 1650 <code>Pull:</code> lines are used by <em>git pull</em> and <em>git fetch</em>.
 1651 Multiple <code>Push:</code> and <code>Pull:</code> lines may
 1652 be specified for additional branch mappings.</p></div>
 1653 </div>
 1654 <div class="sect2">
 1655 <h3 id="_named_file_in_code_git_dir_branches_code">Named file in <code>$GIT_DIR/branches</code></h3>
 1656 <div class="paragraph"><p>You can choose to provide the name of a
 1657 file in <code>$GIT_DIR/branches</code>.
 1658 The URL in this file will be used to access the repository.
 1659 This file should have the following format:</p></div>
 1660 <div class="listingblock">
 1661 <div class="content">
 1662 <pre><code>        &lt;url&gt;#&lt;head&gt;</code></pre>
 1663 </div></div>
 1664 <div class="paragraph"><p><code>&lt;url&gt;</code> is required; <code>#&lt;head&gt;</code> is optional.</p></div>
 1665 <div class="paragraph"><p>Depending on the operation, git will use one of the following
 1666 refspecs, if you don&#8217;t provide one on the command line.
 1667 <code>&lt;branch&gt;</code> is the name of this file in <code>$GIT_DIR/branches</code> and
 1668 <code>&lt;head&gt;</code> defaults to <code>master</code>.</p></div>
 1669 <div class="paragraph"><p>git fetch uses:</p></div>
 1670 <div class="listingblock">
 1671 <div class="content">
 1672 <pre><code>        refs/heads/&lt;head&gt;:refs/heads/&lt;branch&gt;</code></pre>
 1673 </div></div>
 1674 <div class="paragraph"><p>git push uses:</p></div>
 1675 <div class="listingblock">
 1676 <div class="content">
 1677 <pre><code>        HEAD:refs/heads/&lt;head&gt;</code></pre>
 1678 </div></div>
 1679 </div>
 1680 </div>
 1681 </div>
 1682 <div class="sect1">
 1683 <h2 id="_merge_strategies">MERGE STRATEGIES</h2>
 1684 <div class="sectionbody">
 1685 <div class="paragraph"><p>The merge mechanism (<code>git merge</code> and <code>git pull</code> commands) allows the
 1686 backend <em>merge strategies</em> to be chosen with <code>-s</code> option.  Some strategies
 1687 can also take their own options, which can be passed by giving <code>-X&lt;option&gt;</code>
 1688 arguments to <code>git merge</code> and/or <code>git pull</code>.</p></div>
 1689 <div class="dlist"><dl>
 1690 <dt class="hdlist1">
 1691 resolve
 1692 </dt>
 1693 <dd>
 1694 <p>
 1695         This can only resolve two heads (i.e. the current branch
 1696         and another branch you pulled from) using a 3-way merge
 1697         algorithm.  It tries to carefully detect criss-cross
 1698         merge ambiguities and is considered generally safe and
 1699         fast.
 1700 </p>
 1701 </dd>
 1702 <dt class="hdlist1">
 1703 recursive
 1704 </dt>
 1705 <dd>
 1706 <p>
 1707         This can only resolve two heads using a 3-way merge
 1708         algorithm.  When there is more than one common
 1709         ancestor that can be used for 3-way merge, it creates a
 1710         merged tree of the common ancestors and uses that as
 1711         the reference tree for the 3-way merge.  This has been
 1712         reported to result in fewer merge conflicts without
 1713         causing mismerges by tests done on actual merge commits
 1714         taken from Linux 2.6 kernel development history.
 1715         Additionally this can detect and handle merges involving
 1716         renames, but currently cannot make use of detected
 1717         copies.  This is the default merge strategy when pulling
 1718         or merging one branch.
 1719 </p>
 1720 <div class="paragraph"><p>The <em>recursive</em> strategy can take the following options:</p></div>
 1721 <div class="dlist"><dl>
 1722 <dt class="hdlist1">
 1723 ours
 1724 </dt>
 1725 <dd>
 1726 <p>
 1727         This option forces conflicting hunks to be auto-resolved cleanly by
 1728         favoring <em>our</em> version.  Changes from the other tree that do not
 1729         conflict with our side are reflected to the merge result.
 1730         For a binary file, the entire contents are taken from our side.
 1731 </p>
 1732 <div class="paragraph"><p>This should not be confused with the <em>ours</em> merge strategy, which does not
 1733 even look at what the other tree contains at all.  It discards everything
 1734 the other tree did, declaring <em>our</em> history contains all that happened in it.</p></div>
 1735 </dd>
 1736 <dt class="hdlist1">
 1737 theirs
 1738 </dt>
 1739 <dd>
 1740 <p>
 1741         This is the opposite of <em>ours</em>; note that, unlike <em>ours</em>, there is
 1742         no <em>theirs</em> merge strategy to confuse this merge option with.
 1743 </p>
 1744 </dd>
 1745 <dt class="hdlist1">
 1746 patience
 1747 </dt>
 1748 <dd>
 1749 <p>
 1750         With this option, <em>merge-recursive</em> spends a little extra time
 1751         to avoid mismerges that sometimes occur due to unimportant
 1752         matching lines (e.g., braces from distinct functions).  Use
 1753         this when the branches to be merged have diverged wildly.
 1754         See also <a href="git-diff.html">git-diff(1)</a> <code>--patience</code>.
 1755 </p>
 1756 </dd>
 1757 <dt class="hdlist1">
 1758 diff-algorithm=[patience|minimal|histogram|myers]
 1759 </dt>
 1760 <dd>
 1761 <p>
 1762         Tells <em>merge-recursive</em> to use a different diff algorithm, which
 1763         can help avoid mismerges that occur due to unimportant matching
 1764         lines (such as braces from distinct functions).  See also
 1765         <a href="git-diff.html">git-diff(1)</a> <code>--diff-algorithm</code>.
 1766 </p>
 1767 </dd>
 1768 <dt class="hdlist1">
 1769 ignore-space-change
 1770 </dt>
 1771 <dt class="hdlist1">
 1772 ignore-all-space
 1773 </dt>
 1774 <dt class="hdlist1">
 1775 ignore-space-at-eol
 1776 </dt>
 1777 <dt class="hdlist1">
 1778 ignore-cr-at-eol
 1779 </dt>
 1780 <dd>
 1781 <p>
 1782         Treats lines with the indicated type of whitespace change as
 1783         unchanged for the sake of a three-way merge.  Whitespace
 1784         changes mixed with other changes to a line are not ignored.
 1785         See also <a href="git-diff.html">git-diff(1)</a> <code>-b</code>, <code>-w</code>,
 1786         <code>--ignore-space-at-eol</code>, and <code>--ignore-cr-at-eol</code>.
 1787 </p>
 1788 <div class="ulist"><ul>
 1789 <li>
 1790 <p>
 1791 If <em>their</em> version only introduces whitespace changes to a line,
 1792   <em>our</em> version is used;
 1793 </p>
 1794 </li>
 1795 <li>
 1796 <p>
 1797 If <em>our</em> version introduces whitespace changes but <em>their</em>
 1798   version includes a substantial change, <em>their</em> version is used;
 1799 </p>
 1800 </li>
 1801 <li>
 1802 <p>
 1803 Otherwise, the merge proceeds in the usual way.
 1804 </p>
 1805 </li>
 1806 </ul></div>
 1807 </dd>
 1808 <dt class="hdlist1">
 1809 renormalize
 1810 </dt>
 1811 <dd>
 1812 <p>
 1813         This runs a virtual check-out and check-in of all three stages
 1814         of a file when resolving a three-way merge.  This option is
 1815         meant to be used when merging branches with different clean
 1816         filters or end-of-line normalization rules.  See "Merging
 1817         branches with differing checkin/checkout attributes" in
 1818         <a href="gitattributes.html">gitattributes(5)</a> for details.
 1819 </p>
 1820 </dd>
 1821 <dt class="hdlist1">
 1822 no-renormalize
 1823 </dt>
 1824 <dd>
 1825 <p>
 1826         Disables the <code>renormalize</code> option.  This overrides the
 1827         <code>merge.renormalize</code> configuration variable.
 1828 </p>
 1829 </dd>
 1830 <dt class="hdlist1">
 1831 no-renames
 1832 </dt>
 1833 <dd>
 1834 <p>
 1835         Turn off rename detection. This overrides the <code>merge.renames</code>
 1836         configuration variable.
 1837         See also <a href="git-diff.html">git-diff(1)</a> <code>--no-renames</code>.
 1838 </p>
 1839 </dd>
 1840 <dt class="hdlist1">
 1841 find-renames[=&lt;n&gt;]
 1842 </dt>
 1843 <dd>
 1844 <p>
 1845         Turn on rename detection, optionally setting the similarity
 1846         threshold.  This is the default. This overrides the
 1847         <em>merge.renames</em> configuration variable.
 1848         See also <a href="git-diff.html">git-diff(1)</a> <code>--find-renames</code>.
 1849 </p>
 1850 </dd>
 1851 <dt class="hdlist1">
 1852 rename-threshold=&lt;n&gt;
 1853 </dt>
 1854 <dd>
 1855 <p>
 1856         Deprecated synonym for <code>find-renames=&lt;n&gt;</code>.
 1857 </p>
 1858 </dd>
 1859 <dt class="hdlist1">
 1860 subtree[=&lt;path&gt;]
 1861 </dt>
 1862 <dd>
 1863 <p>
 1864         This option is a more advanced form of <em>subtree</em> strategy, where
 1865         the strategy makes a guess on how two trees must be shifted to
 1866         match with each other when merging.  Instead, the specified path
 1867         is prefixed (or stripped from the beginning) to make the shape of
 1868         two trees to match.
 1869 </p>
 1870 </dd>
 1871 </dl></div>
 1872 </dd>
 1873 <dt class="hdlist1">
 1874 octopus
 1875 </dt>
 1876 <dd>
 1877 <p>
 1878         This resolves cases with more than two heads, but refuses to do
 1879         a complex merge that needs manual resolution.  It is
 1880         primarily meant to be used for bundling topic branch
 1881         heads together.  This is the default merge strategy when
 1882         pulling or merging more than one branch.
 1883 </p>
 1884 </dd>
 1885 <dt class="hdlist1">
 1886 ours
 1887 </dt>
 1888 <dd>
 1889 <p>
 1890         This resolves any number of heads, but the resulting tree of the
 1891         merge is always that of the current branch head, effectively
 1892         ignoring all changes from all other branches.  It is meant to
 1893         be used to supersede old development history of side
 1894         branches.  Note that this is different from the -Xours option to
 1895         the <em>recursive</em> merge strategy.
 1896 </p>
 1897 </dd>
 1898 <dt class="hdlist1">
 1899 subtree
 1900 </dt>
 1901 <dd>
 1902 <p>
 1903         This is a modified recursive strategy. When merging trees A and
 1904         B, if B corresponds to a subtree of A, B is first adjusted to
 1905         match the tree structure of A, instead of reading the trees at
 1906         the same level. This adjustment is also done to the common
 1907         ancestor tree.
 1908 </p>
 1909 </dd>
 1910 </dl></div>
 1911 <div class="paragraph"><p>With the strategies that use 3-way merge (including the default, <em>recursive</em>),
 1912 if a change is made on both branches, but later reverted on one of the
 1913 branches, that change will be present in the merged result; some people find
 1914 this behavior confusing.  It occurs because only the heads and the merge base
 1915 are considered when performing a merge, not the individual commits.  The merge
 1916 algorithm therefore considers the reverted change as no change at all, and
 1917 substitutes the changed version instead.</p></div>
 1918 </div>
 1919 </div>
 1920 <div class="sect1">
 1921 <h2 id="_default_behaviour">DEFAULT BEHAVIOUR</h2>
 1922 <div class="sectionbody">
 1923 <div class="paragraph"><p>Often people use <code>git pull</code> without giving any parameter.
 1924 Traditionally, this has been equivalent to saying <code>git pull
 1925 origin</code>.  However, when configuration <code>branch.&lt;name&gt;.remote</code> is
 1926 present while on branch <code>&lt;name&gt;</code>, that value is used instead of
 1927 <code>origin</code>.</p></div>
 1928 <div class="paragraph"><p>In order to determine what URL to use to fetch from, the value
 1929 of the configuration <code>remote.&lt;origin&gt;.url</code> is consulted
 1930 and if there is not any such variable, the value on the <code>URL:</code> line
 1931 in <code>$GIT_DIR/remotes/&lt;origin&gt;</code> is used.</p></div>
 1932 <div class="paragraph"><p>In order to determine what remote branches to fetch (and
 1933 optionally store in the remote-tracking branches) when the command is
 1934 run without any refspec parameters on the command line, values
 1935 of the configuration variable <code>remote.&lt;origin&gt;.fetch</code> are
 1936 consulted, and if there aren&#8217;t any, <code>$GIT_DIR/remotes/&lt;origin&gt;</code>
 1937 is consulted and its <code>Pull:</code> lines are used.
 1938 In addition to the refspec formats described in the OPTIONS
 1939 section, you can have a globbing refspec that looks like this:</p></div>
 1940 <div class="listingblock">
 1941 <div class="content">
 1942 <pre><code>refs/heads/*:refs/remotes/origin/*</code></pre>
 1943 </div></div>
 1944 <div class="paragraph"><p>A globbing refspec must have a non-empty RHS (i.e. must store
 1945 what were fetched in remote-tracking branches), and its LHS and RHS
 1946 must end with <code>/*</code>.  The above specifies that all remote
 1947 branches are tracked using remote-tracking branches in
 1948 <code>refs/remotes/origin/</code> hierarchy under the same name.</p></div>
 1949 <div class="paragraph"><p>The rule to determine which remote branch to merge after
 1950 fetching is a bit involved, in order not to break backward
 1951 compatibility.</p></div>
 1952 <div class="paragraph"><p>If explicit refspecs were given on the command
 1953 line of <code>git pull</code>, they are all merged.</p></div>
 1954 <div class="paragraph"><p>When no refspec was given on the command line, then <code>git pull</code>
 1955 uses the refspec from the configuration or
 1956 <code>$GIT_DIR/remotes/&lt;origin&gt;</code>.  In such cases, the following
 1957 rules apply:</p></div>
 1958 <div class="olist arabic"><ol class="arabic">
 1959 <li>
 1960 <p>
 1961 If <code>branch.&lt;name&gt;.merge</code> configuration for the current
 1962   branch <code>&lt;name&gt;</code> exists, that is the name of the branch at the
 1963   remote site that is merged.
 1964 </p>
 1965 </li>
 1966 <li>
 1967 <p>
 1968 If the refspec is a globbing one, nothing is merged.
 1969 </p>
 1970 </li>
 1971 <li>
 1972 <p>
 1973 Otherwise the remote branch of the first refspec is merged.
 1974 </p>
 1975 </li>
 1976 </ol></div>
 1977 </div>
 1978 </div>
 1979 <div class="sect1">
 1980 <h2 id="_examples">EXAMPLES</h2>
 1981 <div class="sectionbody">
 1982 <div class="ulist"><ul>
 1983 <li>
 1984 <p>
 1985 Update the remote-tracking branches for the repository
 1986   you cloned from, then merge one of them into your
 1987   current branch:
 1988 </p>
 1989 <div class="listingblock">
 1990 <div class="content">
 1991 <pre><code>$ git pull
 1992 $ git pull origin</code></pre>
 1993 </div></div>
 1994 <div class="paragraph"><p>Normally the branch merged in is the HEAD of the remote repository,
 1995 but the choice is determined by the branch.&lt;name&gt;.remote and
 1996 branch.&lt;name&gt;.merge options; see <a href="git-config.html">git-config(1)</a> for details.</p></div>
 1997 </li>
 1998 <li>
 1999 <p>
 2000 Merge into the current branch the remote branch <code>next</code>:
 2001 </p>
 2002 <div class="listingblock">
 2003 <div class="content">
 2004 <pre><code>$ git pull origin next</code></pre>
 2005 </div></div>
 2006 <div class="paragraph"><p>This leaves a copy of <code>next</code> temporarily in FETCH_HEAD, but
 2007 does not update any remote-tracking branches. Using remote-tracking
 2008 branches, the same can be done by invoking fetch and merge:</p></div>
 2009 <div class="listingblock">
 2010 <div class="content">
 2011 <pre><code>$ git fetch origin
 2012 $ git merge origin/next</code></pre>
 2013 </div></div>
 2014 </li>
 2015 </ul></div>
 2016 <div class="paragraph"><p>If you tried a pull which resulted in complex conflicts and
 2017 would want to start over, you can recover with <em>git reset</em>.</p></div>
 2018 </div>
 2019 </div>
 2020 <div class="sect1">
 2021 <h2 id="_security">SECURITY</h2>
 2022 <div class="sectionbody">
 2023 <div class="paragraph"><p>The fetch and push protocols are not designed to prevent one side from
 2024 stealing data from the other repository that was not intended to be
 2025 shared. If you have private data that you need to protect from a malicious
 2026 peer, your best option is to store it in another repository. This applies
 2027 to both clients and servers. In particular, namespaces on a server are not
 2028 effective for read access control; you should only grant read access to a
 2029 namespace to clients that you would trust with read access to the entire
 2030 repository.</p></div>
 2031 <div class="paragraph"><p>The known attack vectors are as follows:</p></div>
 2032 <div class="olist arabic"><ol class="arabic">
 2033 <li>
 2034 <p>
 2035 The victim sends "have" lines advertising the IDs of objects it has that
 2036   are not explicitly intended to be shared but can be used to optimize the
 2037   transfer if the peer also has them. The attacker chooses an object ID X
 2038   to steal and sends a ref to X, but isn&#8217;t required to send the content of
 2039   X because the victim already has it. Now the victim believes that the
 2040   attacker has X, and it sends the content of X back to the attacker
 2041   later. (This attack is most straightforward for a client to perform on a
 2042   server, by creating a ref to X in the namespace the client has access
 2043   to and then fetching it. The most likely way for a server to perform it
 2044   on a client is to "merge" X into a public branch and hope that the user
 2045   does additional work on this branch and pushes it back to the server
 2046   without noticing the merge.)
 2047 </p>
 2048 </li>
 2049 <li>
 2050 <p>
 2051 As in #1, the attacker chooses an object ID X to steal. The victim sends
 2052   an object Y that the attacker already has, and the attacker falsely
 2053   claims to have X and not Y, so the victim sends Y as a delta against X.
 2054   The delta reveals regions of X that are similar to Y to the attacker.
 2055 </p>
 2056 </li>
 2057 </ol></div>
 2058 </div>
 2059 </div>
 2060 <div class="sect1">
 2061 <h2 id="_bugs">BUGS</h2>
 2062 <div class="sectionbody">
 2063 <div class="paragraph"><p>Using --recurse-submodules can only fetch new commits in already checked
 2064 out submodules right now. When e.g. upstream added a new submodule in the
 2065 just fetched commits of the superproject the submodule itself can not be
 2066 fetched, making it impossible to check out that submodule later without
 2067 having to do a fetch again. This is expected to be fixed in a future Git
 2068 version.</p></div>
 2069 </div>
 2070 </div>
 2071 <div class="sect1">
 2072 <h2 id="_see_also">SEE ALSO</h2>
 2073 <div class="sectionbody">
 2074 <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>
 2075 </div>
 2076 </div>
 2077 <div class="sect1">
 2078 <h2 id="_git">GIT</h2>
 2079 <div class="sectionbody">
 2080 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
 2081 </div>
 2082 </div>
 2083 </div>
 2084 <div id="footnotes"><hr /></div>
 2085 <div id="footer">
 2086 <div id="footer-text">
 2087 Last updated
 2088  2018-12-10 16:43:18 JST
 2089 </div>
 2090 </div>
 2091 </body>
 2092 </html>