blob: c3695d5c3d4e249d8b4e8650ff21f91c50558931 [file] [log] [blame]
Junio C Hamanob96f40a2024-08-01 00:57:251<!DOCTYPE html>
2<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3<head>
4<meta charset="UTF-8"/>
5<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
6<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7<meta name="generator" content="Asciidoctor 2.0.20"/>
8<title>git-pull(1)</title>
9<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"/>
10<style>
11/*! Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
12/* Uncomment the following line when using as a custom stylesheet */
13/* @import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"; */
14html{font-family:sans-serif;-webkit-text-size-adjust:100%}
15a{background:none}
16a:focus{outline:thin dotted}
17a:active,a:hover{outline:0}
18h1{font-size:2em;margin:.67em 0}
19b,strong{font-weight:bold}
20abbr{font-size:.9em}
21abbr[title]{cursor:help;border-bottom:1px dotted #dddddf;text-decoration:none}
22dfn{font-style:italic}
23hr{height:0}
24mark{background:#ff0;color:#000}
25code,kbd,pre,samp{font-family:monospace;font-size:1em}
26pre{white-space:pre-wrap}
27q{quotes:"\201C" "\201D" "\2018" "\2019"}
28small{font-size:80%}
29sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
30sup{top:-.5em}
31sub{bottom:-.25em}
32img{border:0}
33svg:not(:root){overflow:hidden}
34figure{margin:0}
35audio,video{display:inline-block}
36audio:not([controls]){display:none;height:0}
37fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
38legend{border:0;padding:0}
39button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
40button,input{line-height:normal}
41button,select{text-transform:none}
42button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}
43button[disabled],html input[disabled]{cursor:default}
44input[type=checkbox],input[type=radio]{padding:0}
45button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
46textarea{overflow:auto;vertical-align:top}
47table{border-collapse:collapse;border-spacing:0}
48*,::before,::after{box-sizing:border-box}
49html,body{font-size:100%}
50body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;line-height:1;position:relative;cursor:auto;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-wrap:anywhere;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
51a:hover{cursor:pointer}
52img,object,embed{max-width:100%;height:auto}
53object,embed{height:100%}
54img{-ms-interpolation-mode:bicubic}
55.left{float:left!important}
56.right{float:right!important}
57.text-left{text-align:left!important}
58.text-right{text-align:right!important}
59.text-center{text-align:center!important}
60.text-justify{text-align:justify!important}
61.hide{display:none}
62img,object,svg{display:inline-block;vertical-align:middle}
63textarea{height:auto;min-height:50px}
64select{width:100%}
65.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
66div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0}
67a{color:#2156a5;text-decoration:underline;line-height:inherit}
68a:hover,a:focus{color:#1d4b8f}
69a img{border:0}
70p{line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}
71p aside{font-size:.875em;line-height:1.35;font-style:italic}
72h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}
73h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}
74h1{font-size:2.125em}
75h2{font-size:1.6875em}
76h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}
77h4,h5{font-size:1.125em}
78h6{font-size:1em}
79hr{border:solid #dddddf;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em}
80em,i{font-style:italic;line-height:inherit}
81strong,b{font-weight:bold;line-height:inherit}
82small{font-size:60%;line-height:inherit}
83code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)}
84ul,ol,dl{line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
85ul,ol{margin-left:1.5em}
86ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0}
87ul.circle{list-style-type:circle}
88ul.disc{list-style-type:disc}
89ul.square{list-style-type:square}
90ul.circle ul:not([class]),ul.disc ul:not([class]),ul.square ul:not([class]){list-style:inherit}
91ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
92dl dt{margin-bottom:.3125em;font-weight:bold}
93dl dd{margin-bottom:1.25em}
94blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
95blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
96@media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
97h1{font-size:2.75em}
98h2{font-size:2.3125em}
99h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
100h4{font-size:1.4375em}}
101table{background:#fff;margin-bottom:1.25em;border:1px solid #dedede;word-wrap:normal}
102table thead,table tfoot{background:#f7f8f7}
103table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
104table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
105table tr.even,table tr.alt{background:#f8f8f7}
106table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{line-height:1.6}
107h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
108h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
109.center{margin-left:auto;margin-right:auto}
110.stretch{width:100%}
111.clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table}
112.clearfix::after,.float-group::after{clear:both}
113:not(pre).nobreak{word-wrap:normal}
114:not(pre).nowrap{white-space:nowrap}
115:not(pre).pre-wrap{white-space:pre-wrap}
116:not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed}
117pre{color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;line-height:1.45;text-rendering:optimizeSpeed}
118pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit}
119pre>code{display:block}
120pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal}
121em em{font-style:normal}
122strong strong{font-weight:400}
123.keyseq{color:rgba(51,51,51,.8)}
124kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 0 rgba(0,0,0,.2),inset 0 0 0 .1em #fff;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
125.keyseq kbd:first-child{margin-left:0}
126.keyseq kbd:last-child{margin-right:0}
127.menuseq,.menuref{color:#000}
128.menuseq b:not(.caret),.menuref{font-weight:inherit}
129.menuseq{word-spacing:-.02em}
130.menuseq b.caret{font-size:1.25em;line-height:.8}
131.menuseq i.caret{font-weight:bold;text-align:center;width:.45em}
132b.button::before,b.button::after{position:relative;top:-1px;font-weight:400}
133b.button::before{content:"[";padding:0 3px 0 2px}
134b.button::after{content:"]";padding:0 2px 0 3px}
135p a>code:hover{color:rgba(0,0,0,.9)}
136#header,#content,#footnotes,#footer{width:100%;margin:0 auto;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
137#header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table}
138#header::after,#content::after,#footnotes::after,#footer::after{clear:both}
139#content{margin-top:1.25em}
140#content::before{content:none}
141#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
142#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf}
143#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
144#header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap}
145#header .details span:first-child{margin-left:-.125em}
146#header .details span.email a{color:rgba(0,0,0,.85)}
147#header .details br{display:none}
148#header .details br+span::before{content:"\00a0\2013\00a0"}
149#header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
150#header .details br+span#revremark::before{content:"\00a0|\00a0"}
151#header #revnumber{text-transform:capitalize}
152#header #revnumber::after{content:"\00a0"}
153#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #dddddf;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
154#toc{border-bottom:1px solid #e7e7e9;padding-bottom:.5em}
155#toc>ul{margin-left:.125em}
156#toc ul.sectlevel0>li>a{font-style:italic}
157#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
158#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
159#toc li{line-height:1.3334;margin-top:.3334em}
160#toc a{text-decoration:none}
161#toc a:active{text-decoration:underline}
162#toctitle{color:#7a2518;font-size:1.2em}
163@media screen and (min-width:768px){#toctitle{font-size:1.375em}
164body.toc2{padding-left:15em;padding-right:0}
165#toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
166#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
167#toc.toc2>ul{font-size:.9em;margin-bottom:0}
168#toc.toc2 ul ul{margin-left:0;padding-left:1em}
169#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
170body.toc2.toc-right{padding-left:0;padding-right:15em}
171body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9;left:auto;right:0}}
172@media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
173#toc.toc2{width:20em}
174#toc.toc2 #toctitle{font-size:1.375em}
175#toc.toc2>ul{font-size:.95em}
176#toc.toc2 ul ul{padding-left:1.25em}
177body.toc2.toc-right{padding-left:0;padding-right:20em}}
178#content #toc{border:1px solid #e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;border-radius:4px}
179#content #toc>:first-child{margin-top:0}
180#content #toc>:last-child{margin-bottom:0}
181#footer{max-width:none;background:rgba(0,0,0,.8);padding:1.25em}
182#footer-text{color:hsla(0,0%,100%,.8);line-height:1.44}
183#content{margin-bottom:.625em}
184.sect1{padding-bottom:.625em}
185@media screen and (min-width:768px){#content{margin-bottom:1.25em}
186.sect1{padding-bottom:1.25em}}
187.sect1:last-child{padding-bottom:0}
188.sect1+.sect1{border-top:1px solid #e7e7e9}
189#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
190#content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
191#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
192#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
193#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
194details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
195details{margin-left:1.25rem}
196details>summary{cursor:pointer;display:block;position:relative;line-height:1.6;margin-bottom:.625rem;outline:none;-webkit-tap-highlight-color:transparent}
197details>summary::-webkit-details-marker{display:none}
198details>summary::before{content:"";border:solid transparent;border-left:solid;border-width:.3em 0 .3em .5em;position:absolute;top:.5em;left:-1.25rem;transform:translateX(15%)}
199details[open]>summary::before{border:solid transparent;border-top:solid;border-width:.5em .3em 0;transform:translateY(15%)}
200details>summary::after{content:"";width:1.25rem;height:1em;position:absolute;top:.3em;left:-1.25rem}
201.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
202table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
203.paragraph.lead>p,#preamble>.sectionbody>[class=paragraph]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)}
204.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
205.admonitionblock>table td.icon{text-align:center;width:80px}
206.admonitionblock>table td.icon img{max-width:none}
207.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
208.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere}
209.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
210.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
211.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
212.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
213.exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
214.exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
215.literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
216@media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
217@media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
218.literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class=highlight],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8}
219.literalblock.output pre{color:#f7f7f8;background:rgba(0,0,0,.9)}
220.listingblock>.content{position:relative}
221.listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:inherit;opacity:.5}
222.listingblock:hover code[data-lang]::before{display:block}
223.listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5}
224.listingblock.terminal pre .command:not([data-prompt])::before{content:"$"}
225.listingblock pre.highlightjs{padding:0}
226.listingblock pre.highlightjs>code{padding:1em;border-radius:4px}
227.listingblock pre.prettyprint{border-width:0}
228.prettyprint{background:#f7f7f8}
229pre.prettyprint .linenums{line-height:1.45;margin-left:2em}
230pre.prettyprint li{background:none;list-style-type:inherit;padding-left:0}
231pre.prettyprint li code[data-lang]::before{opacity:1}
232pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none}
233table.linenotable{border-collapse:separate;border:0;margin-bottom:0;background:none}
234table.linenotable td[class]{color:inherit;vertical-align:top;padding:0;line-height:inherit;white-space:normal}
235table.linenotable td.code{padding-left:.75em}
236table.linenotable td.linenos,pre.pygments .linenos{border-right:1px solid;opacity:.35;padding-right:.5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
237pre.pygments span.linenos{display:inline-block;margin-right:.75em}
238.quoteblock{margin:0 1em 1.25em 1.5em;display:table}
239.quoteblock:not(.excerpt)>.title{margin-left:-1.5em;margin-bottom:.75em}
240.quoteblock blockquote,.quoteblock p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
241.quoteblock blockquote{margin:0;padding:0;border:0}
242.quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
243.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
244.quoteblock .attribution{margin-top:.75em;margin-right:.5ex;text-align:right}
245.verseblock{margin:0 1em 1.25em}
246.verseblock pre{font-family:"Open Sans","DejaVu Sans",sans-serif;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
247.verseblock pre strong{font-weight:400}
248.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
249.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
250.quoteblock .attribution br,.verseblock .attribution br{display:none}
251.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
252.quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none}
253.quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:1.6;word-spacing:0}
254.quoteblock.abstract{margin:0 1em 1.25em;display:block}
255.quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center}
256.quoteblock.excerpt>blockquote,.quoteblock .quoteblock{padding:0 0 .25em 1em;border-left:.25em solid #dddddf}
257.quoteblock.excerpt,.quoteblock .quoteblock{margin-left:0}
258.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:1.0625rem}
259.quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;font-size:.85rem;text-align:left;margin-right:0}
260p.tableblock:last-child{margin-bottom:0}
261td.tableblock>.content{margin-bottom:1.25em;word-wrap:anywhere}
262td.tableblock>.content>:last-child{margin-bottom:-1.25em}
263table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
264table.grid-all>*>tr>*{border-width:1px}
265table.grid-cols>*>tr>*{border-width:0 1px}
266table.grid-rows>*>tr>*{border-width:1px 0}
267table.frame-all{border-width:1px}
268table.frame-ends{border-width:1px 0}
269table.frame-sides{border-width:0 1px}
270table.frame-none>colgroup+*>:first-child>*,table.frame-sides>colgroup+*>:first-child>*{border-top-width:0}
271table.frame-none>:last-child>:last-child>*,table.frame-sides>:last-child>:last-child>*{border-bottom-width:0}
272table.frame-none>*>tr>:first-child,table.frame-ends>*>tr>:first-child{border-left-width:0}
273table.frame-none>*>tr>:last-child,table.frame-ends>*>tr>:last-child{border-right-width:0}
274table.stripes-all>*>tr,table.stripes-odd>*>tr:nth-of-type(odd),table.stripes-even>*>tr:nth-of-type(even),table.stripes-hover>*>tr:hover{background:#f8f8f7}
275th.halign-left,td.halign-left{text-align:left}
276th.halign-right,td.halign-right{text-align:right}
277th.halign-center,td.halign-center{text-align:center}
278th.valign-top,td.valign-top{vertical-align:top}
279th.valign-bottom,td.valign-bottom{vertical-align:bottom}
280th.valign-middle,td.valign-middle{vertical-align:middle}
281table thead th,table tfoot th{font-weight:bold}
282tbody tr th{background:#f7f8f7}
283tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
284p.tableblock>code:only-child{background:none;padding:0}
285p.tableblock{font-size:1em}
286ol{margin-left:1.75em}
287ul li ol{margin-left:1.5em}
288dl dd{margin-left:1.125em}
289dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
290li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
291ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
292ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em}
293ul.unstyled,ol.unstyled{margin-left:0}
294li>p:empty:only-child::before{content:"";display:inline-block}
295ul.checklist>li>p:first-child{margin-left:-1em}
296ul.checklist>li>p:first-child>.fa-square-o:first-child,ul.checklist>li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em}
297ul.checklist>li>p:first-child>input[type=checkbox]:first-child{margin-right:.25em}
298ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em}
299ul.inline>li{margin-left:1.25em}
300.unstyled dl dt{font-weight:400;font-style:normal}
301ol.arabic{list-style-type:decimal}
302ol.decimal{list-style-type:decimal-leading-zero}
303ol.loweralpha{list-style-type:lower-alpha}
304ol.upperalpha{list-style-type:upper-alpha}
305ol.lowerroman{list-style-type:lower-roman}
306ol.upperroman{list-style-type:upper-roman}
307ol.lowergreek{list-style-type:lower-greek}
308.hdlist>table,.colist>table{border:0;background:none}
309.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
310td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
311td.hdlist1{font-weight:bold;padding-bottom:1.25em}
312td.hdlist2{word-wrap:anywhere}
313.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
314.colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top}
315.colist td:not([class]):first-child img{max-width:none}
316.colist td:not([class]):last-child{padding:.25em 0}
317.thumb,.th{line-height:0;display:inline-block;border:4px solid #fff;box-shadow:0 0 0 1px #ddd}
318.imageblock.left{margin:.25em .625em 1.25em 0}
319.imageblock.right{margin:.25em 0 1.25em .625em}
320.imageblock>.title{margin-bottom:0}
321.imageblock.thumb,.imageblock.th{border-width:6px}
322.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
323.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
324.image.left{margin-right:.625em}
325.image.right{margin-left:.625em}
326a.image{text-decoration:none;display:inline-block}
327a.image object{pointer-events:none}
328sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
329sup.footnote a,sup.footnoteref a{text-decoration:none}
330sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
331#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
332#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
333#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
334#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em}
335#footnotes .footnote:last-of-type{margin-bottom:0}
336#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
337div.unbreakable{page-break-inside:avoid}
338.big{font-size:larger}
339.small{font-size:smaller}
340.underline{text-decoration:underline}
341.overline{text-decoration:overline}
342.line-through{text-decoration:line-through}
343.aqua{color:#00bfbf}
344.aqua-background{background:#00fafa}
345.black{color:#000}
346.black-background{background:#000}
347.blue{color:#0000bf}
348.blue-background{background:#0000fa}
349.fuchsia{color:#bf00bf}
350.fuchsia-background{background:#fa00fa}
351.gray{color:#606060}
352.gray-background{background:#7d7d7d}
353.green{color:#006000}
354.green-background{background:#007d00}
355.lime{color:#00bf00}
356.lime-background{background:#00fa00}
357.maroon{color:#600000}
358.maroon-background{background:#7d0000}
359.navy{color:#000060}
360.navy-background{background:#00007d}
361.olive{color:#606000}
362.olive-background{background:#7d7d00}
363.purple{color:#600060}
364.purple-background{background:#7d007d}
365.red{color:#bf0000}
366.red-background{background:#fa0000}
367.silver{color:#909090}
368.silver-background{background:#bcbcbc}
369.teal{color:#006060}
370.teal-background{background:#007d7d}
371.white{color:#bfbfbf}
372.white-background{background:#fafafa}
373.yellow{color:#bfbf00}
374.yellow-background{background:#fafa00}
375span.icon>.fa{cursor:default}
376a span.icon>.fa{cursor:inherit}
377.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
378.admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c}
379.admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
380.admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900}
381.admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400}
382.admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000}
383.conum[data-value]{display:inline-block;color:#fff!important;background:rgba(0,0,0,.8);border-radius:50%;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
384.conum[data-value] *{color:#fff!important}
385.conum[data-value]+b{display:none}
386.conum[data-value]::after{content:attr(data-value)}
387pre .conum[data-value]{position:relative;top:-.125em}
388b.conum *{color:inherit!important}
389.conum:not([data-value]):empty{display:none}
390dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
391h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
392p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
393p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
394p{margin-bottom:1.25rem}
395.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
396.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
397.print-only{display:none!important}
398@page{margin:1.25cm .75cm}
399@media print{*{box-shadow:none!important;text-shadow:none!important}
400html{font-size:80%}
401a{color:inherit!important;text-decoration:underline!important}
402a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
403a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
404abbr[title]{border-bottom:1px dotted}
405abbr[title]::after{content:" (" attr(title) ")"}
406pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
407thead{display:table-header-group}
408svg{max-width:100%}
409p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
410h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
411#header,#content,#footnotes,#footer{max-width:none}
412#toc,.sidebarblock,.exampleblock>.content{background:none!important}
413#toc{border-bottom:1px solid #dddddf!important;padding-bottom:0!important}
414body.book #header{text-align:center}
415body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em}
416body.book #header .details{border:0!important;display:block;padding:0!important}
417body.book #header .details span:first-child{margin-left:0!important}
418body.book #header .details br{display:block}
419body.book #header .details br+span::before{content:none!important}
420body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
421body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
422.listingblock code[data-lang]::before{display:block}
423#footer{padding:0 .9375em}
424.hide-on-print{display:none!important}
425.print-only{display:block!important}
426.hide-for-print{display:none!important}
427.show-for-print{display:inherit!important}}
428@media amzn-kf8,print{#header>h1:first-child{margin-top:1.25rem}
429.sect1{padding:0!important}
430.sect1+.sect1{border:0}
431#footer{background:none}
432#footer-text{color:rgba(0,0,0,.6);font-size:.9em}}
433@media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}}
434</style>
435<style>
436pre>code {
437 display: inline;
438}
439</style>
440</head>
441<body class="manpage">
442<div id="header">
443<h1>git-pull(1) Manual Page</h1>
444<h2 id="_name">NAME</h2>
445<div class="sectionbody">
446<p>git-pull - Fetch from and integrate with another repository or a local branch</p>
447</div>
448</div>
449<div id="content">
450<div class="sect1">
451<h2 id="_synopsis">SYNOPSIS</h2>
452<div class="sectionbody">
453<div class="verseblock">
454<pre class="content"><em>git pull</em> [&lt;options&gt;] [&lt;repository&gt; [&lt;refspec&gt;&#8230;&#8203;]]</pre>
455</div>
456</div>
457</div>
458<div class="sect1">
459<h2 id="_description">DESCRIPTION</h2>
460<div class="sectionbody">
461<div class="paragraph">
462<p>Incorporates changes from a remote repository into the current branch.
463If the current branch is behind the remote, then by default it will
464fast-forward the current branch to match the remote. If the current
465branch and the remote have diverged, the user needs to specify how to
466reconcile the divergent branches with <code>--rebase</code> or <code>--no-rebase</code> (or
467the corresponding configuration option in <code>pull.rebase</code>).</p>
468</div>
469<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:29470<p>More precisely, <code>git</code> <code>pull</code> runs <code>git</code> <code>fetch</code> with the given parameters
Junio C Hamanob96f40a2024-08-01 00:57:25471and then depending on configuration options or command line flags,
Junio C Hamanodc392382024-10-11 18:57:29472will call either <code>git</code> <code>rebase</code> or <code>git</code> <code>merge</code> to reconcile diverging
Junio C Hamanob96f40a2024-08-01 00:57:25473branches.</p>
474</div>
475<div class="paragraph">
476<p>&lt;repository&gt; should be the name of a remote repository as
477passed to <a href="git-fetch.html">git-fetch(1)</a>. &lt;refspec&gt; can name an
478arbitrary remote ref (for example, the name of a tag) or even
479a collection of refs with corresponding remote-tracking branches
480(e.g., refs/heads/*:refs/remotes/origin/*),
481but usually it is the name of a branch in the remote repository.</p>
482</div>
483<div class="paragraph">
484<p>Default values for &lt;repository&gt; and &lt;branch&gt; are read from the
485"remote" and "merge" configuration for the current branch
486as set by <a href="git-branch.html">git-branch(1)</a> <code>--track</code>.</p>
487</div>
488<div class="paragraph">
489<p>Assume the following history exists and the current branch is
490"<code>master</code>":</p>
491</div>
492<div class="listingblock">
493<div class="content">
494<pre> A---B---C master on origin
495 /
496 D---E---F---G master
497 ^
498 origin/master in your repository</pre>
499</div>
500</div>
501<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:29502<p>Then "<code>git</code> <code>pull</code>" will fetch and replay the changes from the remote
Junio C Hamanob96f40a2024-08-01 00:57:25503<code>master</code> branch since it diverged from the local <code>master</code> (i.e., <code>E</code>)
504until its current commit (<code>C</code>) on top of <code>master</code> and record the
505result in a new commit along with the names of the two parent commits
506and a log message from the user describing the changes.</p>
507</div>
508<div class="listingblock">
509<div class="content">
510<pre> A---B---C origin/master
511 / \
512 D---E---F---G---H master</pre>
513</div>
514</div>
515<div class="paragraph">
516<p>See <a href="git-merge.html">git-merge(1)</a> for details, including how conflicts
517are presented and handled.</p>
518</div>
519<div class="paragraph">
520<p>In Git 1.7.0 or later, to cancel a conflicting merge, use
Junio C Hamanodc392382024-10-11 18:57:29521<code>git</code> <code>reset</code> <code>--merge</code>. <strong>Warning</strong>: In older versions of Git, running <em>git pull</em>
Junio C Hamanob96f40a2024-08-01 00:57:25522with uncommitted changes is discouraged: while possible, it leaves you
523in a state that may be hard to back out of in the case of a conflict.</p>
524</div>
525<div class="paragraph">
526<p>If any of the remote changes overlap with local uncommitted changes,
527the merge will be automatically canceled and the work tree untouched.
528It is generally best to get any local changes in working order before
529pulling or stash them away with <a href="git-stash.html">git-stash(1)</a>.</p>
530</div>
531</div>
532</div>
533<div class="sect1">
534<h2 id="_options">OPTIONS</h2>
535<div class="sectionbody">
536<div class="dlist">
537<dl>
538<dt class="hdlist1">-q</dt>
539<dt class="hdlist1">--quiet</dt>
540<dd>
541<p>This is passed to both underlying git-fetch to squelch reporting of
542during transfer, and underlying git-merge to squelch output during
543merging.</p>
544</dd>
545<dt class="hdlist1">-v</dt>
546<dt class="hdlist1">--verbose</dt>
547<dd>
548<p>Pass --verbose to git-fetch and git-merge.</p>
549</dd>
550<dt class="hdlist1">--[no-]recurse-submodules[=(yes|on-demand|no)]</dt>
551<dd>
552<p>This option controls if new commits of populated submodules should
553be fetched, and if the working trees of active submodules should be
554updated, too (see <a href="git-fetch.html">git-fetch(1)</a>, <a href="git-config.html">git-config(1)</a> and
555<a href="gitmodules.html">gitmodules(5)</a>).</p>
556<div class="paragraph">
557<p>If the checkout is done via rebase, local submodule commits are rebased as well.</p>
558</div>
559<div class="paragraph">
560<p>If the update is done via merge, the submodule conflicts are resolved and checked out.</p>
561</div>
562</dd>
563</dl>
564</div>
565<div class="sect2">
566<h3 id="_options_related_to_merging">Options related to merging</h3>
567<div class="dlist">
568<dl>
569<dt class="hdlist1">--commit</dt>
570<dt class="hdlist1">--no-commit</dt>
571<dd>
572<p>Perform the merge and commit the result. This option can
573be used to override --no-commit.
574Only useful when merging.</p>
575<div class="paragraph">
576<p>With --no-commit perform the merge and stop just before creating
577a merge commit, to give the user a chance to inspect and further
578tweak the merge result before committing.</p>
579</div>
580<div class="paragraph">
581<p>Note that fast-forward updates do not create a merge commit and
582therefore there is no way to stop those merges with --no-commit.
583Thus, if you want to ensure your branch is not changed or updated
584by the merge command, use --no-ff with --no-commit.</p>
585</div>
586</dd>
587<dt class="hdlist1">--edit</dt>
588<dt class="hdlist1">-e</dt>
589<dt class="hdlist1">--no-edit</dt>
590<dd>
591<p>Invoke an editor before committing successful mechanical merge to
592further edit the auto-generated merge message, so that the user
593can explain and justify the merge. The <code>--no-edit</code> option can be
594used to accept the auto-generated message (this is generally
595discouraged).</p>
596<div class="paragraph">
597<p>Older scripts may depend on the historical behaviour of not allowing the
598user to edit the merge log message. They will see an editor opened when
Junio C Hamanodc392382024-10-11 18:57:29599they run <code>git</code> <code>merge</code>. To make it easier to adjust such scripts to the
Junio C Hamanob96f40a2024-08-01 00:57:25600updated behaviour, the environment variable <code>GIT_MERGE_AUTOEDIT</code> can be
601set to <code>no</code> at the beginning of them.</p>
602</div>
603</dd>
604<dt class="hdlist1">--cleanup=&lt;mode&gt;</dt>
605<dd>
606<p>This option determines how the merge message will be cleaned up before
607committing. See <a href="git-commit.html">git-commit(1)</a> for more details. In addition, if
608the <em>&lt;mode&gt;</em> is given a value of <code>scissors</code>, scissors will be appended
609to <code>MERGE_MSG</code> before being passed on to the commit machinery in the
610case of a merge conflict.</p>
611</dd>
612<dt class="hdlist1">--ff-only</dt>
613<dd>
614<p>Only update to the new history if there is no divergent local
615history. This is the default when no method for reconciling
616divergent histories is provided (via the --rebase=* flags).</p>
617</dd>
618<dt class="hdlist1">--ff</dt>
619<dt class="hdlist1">--no-ff</dt>
620<dd>
621<p>When merging rather than rebasing, specifies how a merge is
622handled when the merged-in history is already a descendant of
623the current history. If merging is requested, <code>--ff</code> is the
624default unless merging an annotated (and possibly signed) tag
625that is not stored in its natural place in the <code>refs/tags/</code>
626hierarchy, in which case <code>--no-ff</code> is assumed.</p>
627<div class="paragraph">
628<p>With <code>--ff</code>, when possible resolve the merge as a fast-forward (only
629update the branch pointer to match the merged branch; do not create a
630merge commit). When not possible (when the merged-in history is not a
631descendant of the current history), create a merge commit.</p>
632</div>
633<div class="paragraph">
634<p>With <code>--no-ff</code>, create a merge commit in all cases, even when the merge
635could instead be resolved as a fast-forward.</p>
636</div>
637</dd>
638<dt class="hdlist1">-S[&lt;keyid&gt;]</dt>
639<dt class="hdlist1">--gpg-sign[=&lt;keyid&gt;]</dt>
640<dt class="hdlist1">--no-gpg-sign</dt>
641<dd>
642<p>GPG-sign the resulting merge commit. The <code>keyid</code> argument is
643optional and defaults to the committer identity; if specified,
644it must be stuck to the option without a space. <code>--no-gpg-sign</code>
645is useful to countermand both <code>commit.gpgSign</code> configuration variable,
646and earlier <code>--gpg-sign</code>.</p>
647</dd>
648<dt class="hdlist1">--log[=&lt;n&gt;]</dt>
649<dt class="hdlist1">--no-log</dt>
650<dd>
651<p>In addition to branch names, populate the log message with
652one-line descriptions from at most &lt;n&gt; actual commits that are being
653merged. See also <a href="git-fmt-merge-msg.html">git-fmt-merge-msg(1)</a>.
654Only useful when merging.</p>
655<div class="paragraph">
656<p>With --no-log do not list one-line descriptions from the
657actual commits being merged.</p>
658</div>
659</dd>
660<dt class="hdlist1">--signoff</dt>
661<dt class="hdlist1">--no-signoff</dt>
662<dd>
663<p>Add a <code>Signed-off-by</code> trailer by the committer at the end of the commit
664log message. The meaning of a signoff depends on the project
665to which you&#8217;re committing. For example, it may certify that
666the committer has the rights to submit the work under the
667project&#8217;s license or agrees to some contributor representation,
668such as a Developer Certificate of Origin.
669(See <a href="https://developercertificate.org" class="bare">https://developercertificate.org</a> for the one used by the
670Linux kernel and Git projects.) Consult the documentation or
671leadership of the project to which you&#8217;re contributing to
672understand how the signoffs are used in that project.</p>
673<div class="paragraph">
674<p>The --no-signoff option can be used to countermand an earlier --signoff
675option on the command line.</p>
676</div>
677</dd>
678<dt class="hdlist1">--stat</dt>
679<dt class="hdlist1">-n</dt>
680<dt class="hdlist1">--no-stat</dt>
681<dd>
682<p>Show a diffstat at the end of the merge. The diffstat is also
683controlled by the configuration option merge.stat.</p>
684<div class="paragraph">
685<p>With -n or --no-stat do not show a diffstat at the end of the
686merge.</p>
687</div>
688</dd>
689<dt class="hdlist1">--squash</dt>
690<dt class="hdlist1">--no-squash</dt>
691<dd>
692<p>Produce the working tree and index state as if a real merge
693happened (except for the merge information), but do not actually
694make a commit, move the <code>HEAD</code>, or record <code>$GIT_DIR/MERGE_HEAD</code>
Junio C Hamanodc392382024-10-11 18:57:29695(to cause the next <code>git</code> <code>commit</code> command to create a merge
Junio C Hamanob96f40a2024-08-01 00:57:25696commit). This allows you to create a single commit on top of
697the current branch whose effect is the same as merging another
698branch (or more in case of an octopus).</p>
699<div class="paragraph">
700<p>With --no-squash perform the merge and commit the result. This
701option can be used to override --squash.</p>
702</div>
703<div class="paragraph">
704<p>With --squash, --commit is not allowed, and will fail.</p>
705</div>
706<div class="paragraph">
707<p>Only useful when merging.</p>
708</div>
709</dd>
710<dt class="hdlist1">--[no-]verify</dt>
711<dd>
712<p>By default, the pre-merge and commit-msg hooks are run.
713When <code>--no-verify</code> is given, these are bypassed.
714See also <a href="githooks.html">githooks(5)</a>.
715Only useful when merging.</p>
716</dd>
717<dt class="hdlist1">-s &lt;strategy&gt;</dt>
718<dt class="hdlist1">--strategy=&lt;strategy&gt;</dt>
719<dd>
720<p>Use the given merge strategy; can be supplied more than
721once to specify them in the order they should be tried.
722If there is no <code>-s</code> option, a built-in list of strategies
723is used instead (<code>ort</code> when merging a single head,
724<code>octopus</code> otherwise).</p>
725</dd>
726<dt class="hdlist1">-X &lt;option&gt;</dt>
727<dt class="hdlist1">--strategy-option=&lt;option&gt;</dt>
728<dd>
729<p>Pass merge strategy specific option through to the merge
730strategy.</p>
731</dd>
732<dt class="hdlist1">--verify-signatures</dt>
733<dt class="hdlist1">--no-verify-signatures</dt>
734<dd>
735<p>Verify that the tip commit of the side branch being merged is
736signed with a valid key, i.e. a key that has a valid uid: in the
737default trust model, this means the signing key has been signed by
738a trusted key. If the tip commit of the side branch is not signed
739with a valid key, the merge is aborted.</p>
740<div class="paragraph">
741<p>Only useful when merging.</p>
742</div>
743</dd>
744<dt class="hdlist1">--summary</dt>
745<dt class="hdlist1">--no-summary</dt>
746<dd>
747<p>Synonyms to --stat and --no-stat; these are deprecated and will be
748removed in the future.</p>
749</dd>
750<dt class="hdlist1">--autostash</dt>
751<dt class="hdlist1">--no-autostash</dt>
752<dd>
753<p>Automatically create a temporary stash entry before the operation
754begins, record it in the ref <code>MERGE_AUTOSTASH</code>
755and apply it after the operation ends. This means
756that you can run the operation on a dirty worktree. However, use
757with care: the final stash application after a successful
758merge might result in non-trivial conflicts.</p>
759</dd>
760<dt class="hdlist1">--allow-unrelated-histories</dt>
761<dd>
Junio C Hamanodc392382024-10-11 18:57:29762<p>By default, <code>git</code> <code>merge</code> command refuses to merge histories
Junio C Hamanob96f40a2024-08-01 00:57:25763that do not share a common ancestor. This option can be
764used to override this safety when merging histories of two
765projects that started their lives independently. As that is
766a very rare occasion, no configuration variable to enable
767this by default exists and will not be added.</p>
768<div class="paragraph">
769<p>Only useful when merging.</p>
770</div>
771</dd>
772<dt class="hdlist1">-r</dt>
773<dt class="hdlist1">--rebase[=(false|true|merges|interactive)]</dt>
774<dd>
775<p>When true, rebase the current branch on top of the upstream
776branch after fetching. If there is a remote-tracking branch
777corresponding to the upstream branch and the upstream branch
778was rebased since last fetched, the rebase uses that information
779to avoid rebasing non-local changes.</p>
780<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:29781<p>When set to <code>merges</code>, rebase using <code>git</code> <code>rebase</code> <code>--rebase-merges</code> so that
Junio C Hamanob96f40a2024-08-01 00:57:25782the local merge commits are included in the rebase (see
783<a href="git-rebase.html">git-rebase(1)</a> for details).</p>
784</div>
785<div class="paragraph">
786<p>When false, merge the upstream branch into the current branch.</p>
787</div>
788<div class="paragraph">
789<p>When <code>interactive</code>, enable the interactive mode of rebase.</p>
790</div>
791<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:29792<p>See <code>pull.rebase</code>, <code>branch.</code><em>&lt;name&gt;</em><code>.rebase</code> and <code>branch.autoSetupRebase</code> in
793<a href="git-config.html">git-config(1)</a> if you want to make <code>git</code> <code>pull</code> always use
Junio C Hamanob96f40a2024-08-01 00:57:25794<code>--rebase</code> instead of merging.</p>
795</div>
796<div class="admonitionblock note">
797<table>
798<tr>
799<td class="icon">
800<div class="title">Note</div>
801</td>
802<td class="content">
803This is a potentially <em>dangerous</em> mode of operation.
804It rewrites history, which does not bode well when you
805published that history already. Do <strong>not</strong> use this option
806unless you have read <a href="git-rebase.html">git-rebase(1)</a> carefully.
807</td>
808</tr>
809</table>
810</div>
811</dd>
812<dt class="hdlist1">--no-rebase</dt>
813<dd>
814<p>This is shorthand for --rebase=false.</p>
815</dd>
816</dl>
817</div>
818</div>
819<div class="sect2">
820<h3 id="_options_related_to_fetching">Options related to fetching</h3>
821<div class="dlist">
822<dl>
823<dt class="hdlist1">--[no-]all</dt>
824<dd>
Junio C Hamano210f01b2024-09-14 16:10:50825<p>Fetch all remotes, except for the ones that has the
Junio C Hamanodc392382024-10-11 18:57:29826<code>remote.</code><em>&lt;name&gt;</em><code>.skipFetchAll</code> configuration variable set.
Junio C Hamano210f01b2024-09-14 16:10:50827This overrides the configuration variable fetch.all`.</p>
Junio C Hamanob96f40a2024-08-01 00:57:25828</dd>
829<dt class="hdlist1">-a</dt>
830<dt class="hdlist1">--append</dt>
831<dd>
832<p>Append ref names and object names of fetched refs to the
Junio C Hamanodc392382024-10-11 18:57:29833existing contents of .<code>git/FETCH_HEAD</code>. Without this
834option old data in .<code>git/FETCH_HEAD</code> will be overwritten.</p>
Junio C Hamanob96f40a2024-08-01 00:57:25835</dd>
836<dt class="hdlist1">--atomic</dt>
837<dd>
838<p>Use an atomic transaction to update local refs. Either all refs are
839updated, or on error, no refs are updated.</p>
840</dd>
841<dt class="hdlist1">--depth=&lt;depth&gt;</dt>
842<dd>
843<p>Limit fetching to the specified number of commits from the tip of
844each remote branch history. If fetching to a <em>shallow</em> repository
Junio C Hamanodc392382024-10-11 18:57:29845created by <code>git</code> <code>clone</code> with <code>--depth=</code><em>&lt;depth&gt;</em> option (see
Junio C Hamanob96f40a2024-08-01 00:57:25846<a href="git-clone.html">git-clone(1)</a>), deepen or shorten the history to the specified
847number of commits. Tags for the deepened commits are not fetched.</p>
848</dd>
849<dt class="hdlist1">--deepen=&lt;depth&gt;</dt>
850<dd>
851<p>Similar to --depth, except it specifies the number of commits
852from the current shallow boundary instead of from the tip of
853each remote branch history.</p>
854</dd>
855<dt class="hdlist1">--shallow-since=&lt;date&gt;</dt>
856<dd>
857<p>Deepen or shorten the history of a shallow repository to
858include all reachable commits after &lt;date&gt;.</p>
859</dd>
860<dt class="hdlist1">--shallow-exclude=&lt;revision&gt;</dt>
861<dd>
862<p>Deepen or shorten the history of a shallow repository to
863exclude commits reachable from a specified remote branch or tag.
864This option can be specified multiple times.</p>
865</dd>
866<dt class="hdlist1">--unshallow</dt>
867<dd>
868<p>If the source repository is complete, convert a shallow
869repository to a complete one, removing all the limitations
870imposed by shallow repositories.</p>
871<div class="paragraph">
872<p>If the source repository is shallow, fetch as much as possible so that
873the current repository has the same history as the source repository.</p>
874</div>
875</dd>
876<dt class="hdlist1">--update-shallow</dt>
877<dd>
878<p>By default when fetching from a shallow repository,
Junio C Hamanodc392382024-10-11 18:57:29879<code>git</code> <code>fetch</code> refuses refs that require updating
Junio C Hamanob96f40a2024-08-01 00:57:25880.git/shallow. This option updates .git/shallow and accepts such
881refs.</p>
882</dd>
883<dt class="hdlist1">--negotiation-tip=&lt;commit|glob&gt;</dt>
884<dd>
885<p>By default, Git will report, to the server, commits reachable
886from all local refs to find common commits in an attempt to
887reduce the size of the to-be-received packfile. If specified,
888Git will only report commits reachable from the given tips.
889This is useful to speed up fetches when the user knows which
890local ref is likely to have commits in common with the
891upstream ref being fetched.</p>
892<div class="paragraph">
893<p>This option may be specified more than once; if so, Git will report
894commits reachable from any of the given commits.</p>
895</div>
896<div class="paragraph">
897<p>The argument to this option may be a glob on ref names, a ref, or the (possibly
898abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying
899this option multiple times, one for each matching ref name.</p>
900</div>
901<div class="paragraph">
902<p>See also the <code>fetch.negotiationAlgorithm</code> and <code>push.negotiate</code>
903configuration variables documented in <a href="git-config.html">git-config(1)</a>, and the
904<code>--negotiate-only</code> option below.</p>
905</div>
906</dd>
907<dt class="hdlist1">--negotiate-only</dt>
908<dd>
909<p>Do not fetch anything from the server, and instead print the
Junio C Hamanodc392382024-10-11 18:57:29910ancestors of the provided <code>--negotiation-tip=</code>* arguments,
Junio C Hamanob96f40a2024-08-01 00:57:25911which we have in common with the server.</p>
912<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:29913<p>This is incompatible with <code>--recurse-submodules=</code>[<code>yes</code>|<code>on-demand</code>].
Junio C Hamanob96f40a2024-08-01 00:57:25914Internally this is used to implement the <code>push.negotiate</code> option, see
915<a href="git-config.html">git-config(1)</a>.</p>
916</div>
917</dd>
918<dt class="hdlist1">--dry-run</dt>
919<dd>
920<p>Show what would be done, without making any changes.</p>
921</dd>
922<dt class="hdlist1">--porcelain</dt>
923<dd>
924<p>Print the output to standard output in an easy-to-parse format for
925scripts. See section OUTPUT in <a href="git-fetch.html">git-fetch(1)</a> for details.</p>
926<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:29927<p>This is incompatible with <code>--recurse-submodules=</code>[<code>yes</code>|<code>on-demand</code>] and takes
Junio C Hamanob96f40a2024-08-01 00:57:25928precedence over the <code>fetch.output</code> config option.</p>
929</div>
930</dd>
931<dt class="hdlist1">-f</dt>
932<dt class="hdlist1">--force</dt>
933<dd>
Junio C Hamanodc392382024-10-11 18:57:29934<p>When <em>git fetch</em> is used with <em>&lt;src&gt;</em><code>:</code><em>&lt;dst&gt;</em> refspec, it may
Junio C Hamanob96f40a2024-08-01 00:57:25935refuse to update the local branch as discussed
Junio C Hamanodc392382024-10-11 18:57:29936in the <em>&lt;refspec&gt;</em> part of the <a href="git-fetch.html">git-fetch(1)</a>
Junio C Hamanob96f40a2024-08-01 00:57:25937documentation.
938This option overrides that check.</p>
939</dd>
940<dt class="hdlist1">-k</dt>
941<dt class="hdlist1">--keep</dt>
942<dd>
943<p>Keep downloaded pack.</p>
944</dd>
945<dt class="hdlist1">--prefetch</dt>
946<dd>
947<p>Modify the configured refspec to place all refs into the
948<code>refs/prefetch/</code> namespace. See the <code>prefetch</code> task in
949<a href="git-maintenance.html">git-maintenance(1)</a>.</p>
950</dd>
951<dt class="hdlist1">-p</dt>
952<dt class="hdlist1">--prune</dt>
953<dd>
954<p>Before fetching, remove any remote-tracking references that no
955longer exist on the remote. Tags are not subject to pruning
956if they are fetched only because of the default tag
957auto-following or due to a --tags option. However, if tags
958are fetched due to an explicit refspec (either on the command
959line or in the remote configuration, for example if the remote
960was cloned with the --mirror option), then they are also
961subject to pruning. Supplying <code>--prune-tags</code> is a shorthand for
962providing the tag refspec.</p>
963</dd>
964<dt class="hdlist1">--no-tags</dt>
965<dd>
966<p>By default, tags that point at objects that are downloaded
967from the remote repository are fetched and stored locally.
968This option disables this automatic tag following. The default
969behavior for a remote may be specified with the remote.&lt;name&gt;.tagOpt
970setting. See <a href="git-config.html">git-config(1)</a>.</p>
971</dd>
972<dt class="hdlist1">--refmap=&lt;refspec&gt;</dt>
973<dd>
974<p>When fetching refs listed on the command line, use the
975specified refspec (can be given more than once) to map the
976refs to remote-tracking branches, instead of the values of
Junio C Hamanodc392382024-10-11 18:57:29977<code>remote.</code>*.<code>fetch</code> configuration variables for the remote
978repository. Providing an empty <em>&lt;refspec&gt;</em> to the
Junio C Hamanob96f40a2024-08-01 00:57:25979<code>--refmap</code> option causes Git to ignore the configured
980refspecs and rely entirely on the refspecs supplied as
981command-line arguments. See section on "Configured Remote-tracking
982Branches" for details.</p>
983</dd>
984<dt class="hdlist1">-t</dt>
985<dt class="hdlist1">--tags</dt>
986<dd>
987<p>Fetch all tags from the remote (i.e., fetch remote tags
Junio C Hamanodc392382024-10-11 18:57:29988<code>refs/tags/</code>* into local tags with the same name), in addition
Junio C Hamanob96f40a2024-08-01 00:57:25989to whatever else would otherwise be fetched. Using this
990option alone does not subject tags to pruning, even if --prune
991is used (though tags may be pruned anyway if they are also the
992destination of an explicit refspec; see <code>--prune</code>).</p>
993</dd>
994<dt class="hdlist1">-j</dt>
995<dt class="hdlist1">--jobs=&lt;n&gt;</dt>
996<dd>
997<p>Number of parallel children to be used for all forms of fetching.</p>
998<div class="paragraph">
999<p>If the <code>--multiple</code> option was specified, the different remotes will be fetched
1000in parallel. If multiple submodules are fetched, they will be fetched in
1001parallel. To control them independently, use the config settings
1002<code>fetch.parallel</code> and <code>submodule.fetchJobs</code> (see <a href="git-config.html">git-config(1)</a>).</p>
1003</div>
1004<div class="paragraph">
1005<p>Typically, parallel recursive and multi-remote fetches will be faster. By
1006default fetches are performed sequentially, not in parallel.</p>
1007</div>
1008</dd>
1009<dt class="hdlist1">--set-upstream</dt>
1010<dd>
1011<p>If the remote is fetched successfully, add upstream
1012(tracking) reference, used by argument-less
1013<a href="git-pull.html">git-pull(1)</a> and other commands. For more information,
Junio C Hamanodc392382024-10-11 18:57:291014see <code>branch.</code><em>&lt;name&gt;</em><code>.merge</code> and <code>branch.</code><em>&lt;name&gt;</em><code>.remote</code> in
Junio C Hamanob96f40a2024-08-01 00:57:251015<a href="git-config.html">git-config(1)</a>.</p>
1016</dd>
1017<dt class="hdlist1">--upload-pack &lt;upload-pack&gt;</dt>
1018<dd>
1019<p>When given, and the repository to fetch from is handled
Junio C Hamanodc392382024-10-11 18:57:291020by <em>git fetch-pack</em>, <code>--exec=</code><em>&lt;upload-pack&gt;</em> is passed to
Junio C Hamanob96f40a2024-08-01 00:57:251021the command to specify non-default path for the command
1022run on the other end.</p>
1023</dd>
1024<dt class="hdlist1">--progress</dt>
1025<dd>
1026<p>Progress status is reported on the standard error stream
1027by default when it is attached to a terminal, unless -q
1028is specified. This flag forces progress status even if the
1029standard error stream is not directed to a terminal.</p>
1030</dd>
1031<dt class="hdlist1">-o &lt;option&gt;</dt>
1032<dt class="hdlist1">--server-option=&lt;option&gt;</dt>
1033<dd>
1034<p>Transmit the given string to the server when communicating using
1035protocol version 2. The given string must not contain a NUL or LF
1036character. The server&#8217;s handling of server options, including
1037unknown ones, is server-specific.
Junio C Hamanodc392382024-10-11 18:57:291038When multiple <code>--server-option=</code><em>&lt;option&gt;</em> are given, they are all
Junio C Hamanof4e4f532024-11-02 05:48:111039sent to the other side in the order listed on the command line.
1040When no <code>--server-option=</code><em>&lt;option&gt;</em> is given from the command line,
1041the values of configuration variable <code>remote.</code><em>&lt;name&gt;</em><code>.serverOption</code>
1042are used instead.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251043</dd>
1044<dt class="hdlist1">--show-forced-updates</dt>
1045<dd>
1046<p>By default, git checks if a branch is force-updated during
1047fetch. This can be disabled through fetch.showForcedUpdates, but
1048the --show-forced-updates option guarantees this check occurs.
1049See <a href="git-config.html">git-config(1)</a>.</p>
1050</dd>
1051<dt class="hdlist1">--no-show-forced-updates</dt>
1052<dd>
1053<p>By default, git checks if a branch is force-updated during
1054fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates
1055to false to skip this check for performance reasons. If used during
1056<em>git-pull</em> the --ff-only option will still check for forced updates
1057before attempting a fast-forward update. See <a href="git-config.html">git-config(1)</a>.</p>
1058</dd>
1059<dt class="hdlist1">-4</dt>
1060<dt class="hdlist1">--ipv4</dt>
1061<dd>
1062<p>Use IPv4 addresses only, ignoring IPv6 addresses.</p>
1063</dd>
1064<dt class="hdlist1">-6</dt>
1065<dt class="hdlist1">--ipv6</dt>
1066<dd>
1067<p>Use IPv6 addresses only, ignoring IPv4 addresses.</p>
1068</dd>
1069<dt class="hdlist1">&lt;repository&gt;</dt>
1070<dd>
1071<p>The "remote" repository that is the source of a fetch
1072or pull operation. This parameter can be either a URL
1073(see the section <a href="#URLS">GIT URLS</a> below) or the name
1074of a remote (see the section <a href="#REMOTES">REMOTES</a> below).</p>
1075</dd>
1076<dt class="hdlist1">&lt;refspec&gt;</dt>
1077<dd>
1078<p>Specifies which refs to fetch and which local refs to update.
1079When no &lt;refspec&gt;s appear on the command line, the refs to fetch
Junio C Hamanodc392382024-10-11 18:57:291080are read from <code>remote.</code><em>&lt;repository&gt;</em><code>.fetch</code> variables instead
Junio C Hamanob96f40a2024-08-01 00:57:251081(see the section "CONFIGURED REMOTE-TRACKING BRANCHES"
1082in <a href="git-fetch.html">git-fetch(1)</a>).</p>
1083<div class="paragraph">
1084<p>The format of a &lt;refspec&gt; parameter is an optional plus
1085<code>+</code>, followed by the source &lt;src&gt;, followed
Junio C Hamanof4e4f532024-11-02 05:48:111086by a colon <code>:</code>, followed by the destination &lt;dst&gt;.
Junio C Hamanob96f40a2024-08-01 00:57:251087The colon can be omitted when &lt;dst&gt; is empty. &lt;src&gt; is
Junio C Hamanof4e4f532024-11-02 05:48:111088typically a ref, or a glob pattern with a single * that is used
1089to match a set of refs, but it can also be a fully spelled hex object
Junio C Hamanob96f40a2024-08-01 00:57:251090name.</p>
1091</div>
1092<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291093<p>A &lt;refspec&gt; may contain a * in its &lt;src&gt; to indicate a simple pattern
Junio C Hamanob96f40a2024-08-01 00:57:251094match. Such a refspec functions like a glob that matches any ref with the
Junio C Hamanof4e4f532024-11-02 05:48:111095pattern. A pattern &lt;refspec&gt; must have one and only one * in both the &lt;src&gt; and
Junio C Hamanodc392382024-10-11 18:57:291096&lt;dst&gt;. It will map refs to the destination by replacing the * with the
Junio C Hamanob96f40a2024-08-01 00:57:251097contents matched from the source.</p>
1098</div>
1099<div class="paragraph">
1100<p>If a refspec is prefixed by <code>^</code>, it will be interpreted as a negative
1101refspec. Rather than specifying which refs to fetch or which local refs to
1102update, such a refspec will instead specify refs to exclude. A ref will be
1103considered to match if it matches at least one positive refspec, and does
1104not match any negative refspec. Negative refspecs can be useful to restrict
1105the scope of a pattern refspec so that it will not include specific refs.
1106Negative refspecs can themselves be pattern refspecs. However, they may only
1107contain a &lt;src&gt; and do not specify a &lt;dst&gt;. Fully spelled out hex object
1108names are also not supported.</p>
1109</div>
1110<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291111<p><code>tag</code> <em>&lt;tag&gt;</em> means the same as <code>refs/tags/</code><em>&lt;tag&gt;</em><code>:refs/tags/</code><em>&lt;tag&gt;</em>;
Junio C Hamanob96f40a2024-08-01 00:57:251112it requests fetching everything up to the given tag.</p>
1113</div>
1114<div class="paragraph">
1115<p>The remote ref that matches &lt;src&gt;
1116is fetched, and if &lt;dst&gt; is not an empty string, an attempt
1117is made to update the local ref that matches it.</p>
1118</div>
1119<div class="paragraph">
1120<p>Whether that update is allowed without <code>--force</code> depends on the ref
1121namespace it&#8217;s being fetched to, the type of object being fetched, and
1122whether the update is considered to be a fast-forward. Generally, the
Junio C Hamanodc392382024-10-11 18:57:291123same rules apply for fetching as when pushing, see the <em>&lt;refspec&gt;</em>...
Junio C Hamanob96f40a2024-08-01 00:57:251124section of <a href="git-push.html">git-push(1)</a> for what those are. Exceptions to those
1125rules particular to <em>git fetch</em> are noted below.</p>
1126</div>
1127<div class="paragraph">
1128<p>Until Git version 2.20, and unlike when pushing with
Junio C Hamanodc392382024-10-11 18:57:291129<a href="git-push.html">git-push(1)</a>, any updates to <code>refs/tags/</code>* would be accepted
Junio C Hamanob96f40a2024-08-01 00:57:251130without <code>+</code> in the refspec (or <code>--force</code>). When fetching, we promiscuously
1131considered all tag updates from a remote to be forced fetches. Since
Junio C Hamanodc392382024-10-11 18:57:291132Git version 2.20, fetching to update <code>refs/tags/</code>* works the same way
Junio C Hamanob96f40a2024-08-01 00:57:251133as when pushing. I.e. any updates will be rejected without <code>+</code> in the
1134refspec (or <code>--force</code>).</p>
1135</div>
1136<div class="paragraph">
1137<p>Unlike when pushing with <a href="git-push.html">git-push(1)</a>, any updates outside of
Junio C Hamanodc392382024-10-11 18:57:291138<code>refs/</code>{tags,heads}/* will be accepted without <code>+</code> in the refspec (or
Junio C Hamanob96f40a2024-08-01 00:57:251139<code>--force</code>), whether that&#8217;s swapping e.g. a tree object for a blob, or
1140a commit for another commit that doesn&#8217;t have the previous commit as
1141an ancestor etc.</p>
1142</div>
1143<div class="paragraph">
1144<p>Unlike when pushing with <a href="git-push.html">git-push(1)</a>, there is no
1145configuration which&#8217;ll amend these rules, and nothing like a
1146<code>pre-fetch</code> hook analogous to the <code>pre-receive</code> hook.</p>
1147</div>
1148<div class="paragraph">
1149<p>As with pushing with <a href="git-push.html">git-push(1)</a>, all of the rules described
1150above about what&#8217;s not allowed as an update can be overridden by
1151adding an optional leading <code>+</code> to a refspec (or using the <code>--force</code>
1152command line option). The only exception to this is that no amount of
Junio C Hamanodc392382024-10-11 18:57:291153forcing will make the <code>refs/heads/</code>* namespace accept a non-commit
Junio C Hamanob96f40a2024-08-01 00:57:251154object.</p>
1155</div>
1156<div class="admonitionblock note">
1157<table>
1158<tr>
1159<td class="icon">
1160<div class="title">Note</div>
1161</td>
1162<td class="content">
1163When the remote branch you want to fetch is known to
1164be rewound and rebased regularly, it is expected that
1165its new tip will not be a descendant of its previous tip
1166(as stored in your remote-tracking branch the last time
1167you fetched). You would want
1168to use the <code>+</code> sign to indicate non-fast-forward updates
1169will be needed for such branches. There is no way to
1170determine or declare that a branch will be made available
1171in a repository with this behavior; the pulling user simply
1172must know this is the expected usage pattern for a branch.
1173</td>
1174</tr>
1175</table>
1176</div>
1177<div class="admonitionblock note">
1178<table>
1179<tr>
1180<td class="icon">
1181<div class="title">Note</div>
1182</td>
1183<td class="content">
1184There is a difference between listing multiple &lt;refspec&gt;
1185directly on <em>git pull</em> command line and having multiple
Junio C Hamanodc392382024-10-11 18:57:291186<code>remote.</code><em>&lt;repository&gt;</em><code>.fetch</code> entries in your configuration
Junio C Hamanob96f40a2024-08-01 00:57:251187for a &lt;repository&gt; and running a
1188<em>git pull</em> command without any explicit &lt;refspec&gt; parameters.
1189&lt;refspec&gt;s listed explicitly on the command line are always
1190merged into the current branch after fetching. In other words,
1191if you list more than one remote ref, <em>git pull</em> will create
1192an Octopus merge. On the other hand, if you do not list any
1193explicit &lt;refspec&gt; parameter on the command line, <em>git pull</em>
1194will fetch all the &lt;refspec&gt;s it finds in the
Junio C Hamanodc392382024-10-11 18:57:291195<code>remote.</code><em>&lt;repository&gt;</em><code>.fetch</code> configuration and merge
Junio C Hamanob96f40a2024-08-01 00:57:251196only the first &lt;refspec&gt; found into the current branch.
1197This is because making an
1198Octopus from remote refs is rarely done, while keeping track
1199of multiple remote heads in one-go by fetching more than one
1200is often useful.
1201</td>
1202</tr>
1203</table>
1204</div>
1205</dd>
1206</dl>
1207</div>
1208</div>
1209</div>
1210</div>
1211<div class="sect1">
1212<h2 id="_git_urls">GIT URLS<a id="URLS"></a></h2>
1213<div class="sectionbody">
1214<div class="paragraph">
1215<p>In general, URLs contain information about the transport protocol, the
1216address of the remote server, and the path to the repository.
1217Depending on the transport protocol, some of this information may be
1218absent.</p>
1219</div>
1220<div class="paragraph">
1221<p>Git supports ssh, git, http, and https protocols (in addition, ftp
1222and ftps can be used for fetching, but this is inefficient and
1223deprecated; do not use them).</p>
1224</div>
1225<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291226<p>The native transport (i.e. <code>git://</code> URL) does no authentication and
Junio C Hamanob96f40a2024-08-01 00:57:251227should be used with caution on unsecured networks.</p>
1228</div>
1229<div class="paragraph">
1230<p>The following syntaxes may be used with them:</p>
1231</div>
1232<div class="ulist">
1233<ul>
1234<li>
1235<p><code>ssh://</code>[<em>&lt;user&gt;</em><code>@</code>]<em>&lt;host&gt;</em>[<code>:</code><em>&lt;port&gt;</em>]<code>/</code><em>&lt;path-to-git-repo&gt;</em></p>
1236</li>
1237<li>
Junio C Hamanodc392382024-10-11 18:57:291238<p><code>git://</code><em>&lt;host&gt;</em>[<code>:</code><em>&lt;port&gt;</em>]<code>/</code><em>&lt;path-to-git-repo&gt;</em></p>
Junio C Hamanob96f40a2024-08-01 00:57:251239</li>
1240<li>
1241<p><code>http</code>[<code>s</code>]<code>://</code><em>&lt;host&gt;</em>[<code>:</code><em>&lt;port&gt;</em>]<code>/</code><em>&lt;path-to-git-repo&gt;</em></p>
1242</li>
1243<li>
1244<p><code>ftp</code>[<code>s</code>]<code>://</code><em>&lt;host&gt;</em>[<code>:</code><em>&lt;port&gt;</em>]<code>/</code><em>&lt;path-to-git-repo&gt;</em></p>
1245</li>
1246</ul>
1247</div>
1248<div class="paragraph">
1249<p>An alternative scp-like syntax may also be used with the ssh protocol:</p>
1250</div>
1251<div class="ulist">
1252<ul>
1253<li>
1254<p>[<em>&lt;user&gt;</em><code>@</code>]<em>&lt;host&gt;</em><code>:/</code><em>&lt;path-to-git-repo&gt;</em></p>
1255</li>
1256</ul>
1257</div>
1258<div class="paragraph">
1259<p>This syntax is only recognized if there are no slashes before the
1260first colon. This helps differentiate a local path that contains a
1261colon. For example the local path <code>foo:bar</code> could be specified as an
Junio C Hamanodc392382024-10-11 18:57:291262absolute path or .<code>/foo:bar</code> to avoid being misinterpreted as an ssh
Junio C Hamanob96f40a2024-08-01 00:57:251263url.</p>
1264</div>
1265<div class="paragraph">
1266<p>The ssh and git protocols additionally support <code>~</code><em>&lt;username&gt;</em> expansion:</p>
1267</div>
1268<div class="ulist">
1269<ul>
1270<li>
1271<p><code>ssh://</code>[<em>&lt;user&gt;</em><code>@</code>]<em>&lt;host&gt;</em>[<code>:</code><em>&lt;port&gt;</em>]<code>/~</code><em>&lt;user&gt;</em><code>/</code><em>&lt;path-to-git-repo&gt;</em></p>
1272</li>
1273<li>
1274<p><code>git://</code><em>&lt;host&gt;</em>[<code>:</code><em>&lt;port&gt;</em>]<code>/~</code><em>&lt;user&gt;</em><code>/</code><em>&lt;path-to-git-repo&gt;</em></p>
1275</li>
1276<li>
1277<p>[<em>&lt;user&gt;</em><code>@</code>]<em>&lt;host&gt;</em><code>:~</code><em>&lt;user&gt;</em><code>/</code><em>&lt;path-to-git-repo&gt;</em></p>
1278</li>
1279</ul>
1280</div>
1281<div class="paragraph">
1282<p>For local repositories, also supported by Git natively, the following
1283syntaxes may be used:</p>
1284</div>
1285<div class="ulist">
1286<ul>
1287<li>
1288<p><code>/path/to/repo.git/</code></p>
1289</li>
1290<li>
Junio C Hamanodc392382024-10-11 18:57:291291<p><code>file:///path/to/repo.git/</code></p>
Junio C Hamanob96f40a2024-08-01 00:57:251292</li>
1293</ul>
1294</div>
1295<div class="paragraph">
1296<p>These two syntaxes are mostly equivalent, except when cloning, when
1297the former implies <code>--local</code> option. See <a href="git-clone.html">git-clone(1)</a> for
1298details.</p>
1299</div>
1300<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291301<p><code>git</code> <code>clone</code>, <code>git</code> <code>fetch</code> and <code>git</code> <code>pull</code>, but not <code>git</code> <code>push</code>, will also
Junio C Hamanob96f40a2024-08-01 00:57:251302accept a suitable bundle file. See <a href="git-bundle.html">git-bundle(1)</a>.</p>
1303</div>
1304<div class="paragraph">
1305<p>When Git doesn&#8217;t know how to handle a certain transport protocol, it
1306attempts to use the <code>remote-</code><em>&lt;transport&gt;</em> remote helper, if one
1307exists. To explicitly request a remote helper, the following syntax
1308may be used:</p>
1309</div>
1310<div class="ulist">
1311<ul>
1312<li>
Junio C Hamanodc392382024-10-11 18:57:291313<p><em>&lt;transport&gt;</em><code>::</code><em>&lt;address&gt;</em></p>
Junio C Hamanob96f40a2024-08-01 00:57:251314</li>
1315</ul>
1316</div>
1317<div class="paragraph">
1318<p>where <em>&lt;address&gt;</em> may be a path, a server and path, or an arbitrary
1319URL-like string recognized by the specific remote helper being
1320invoked. See <a href="gitremote-helpers.html">gitremote-helpers(7)</a> for details.</p>
1321</div>
1322<div class="paragraph">
1323<p>If there are a large number of similarly-named remote repositories and
1324you want to use a different format for them (such that the URLs you
1325use will be rewritten into URLs that work), you can create a
1326configuration section of the form:</p>
1327</div>
1328<div class="verseblock">
1329<pre class="content"> [url "<em>&lt;actual-url-base&gt;</em>"]
1330 insteadOf = <em>&lt;other-url-base&gt;</em></pre>
1331</div>
1332<div class="paragraph">
1333<p>For example, with this:</p>
1334</div>
1335<div class="listingblock">
1336<div class="content">
1337<pre> [url "git://git.host.xz/"]
1338 insteadOf = host.xz:/path/to/
1339 insteadOf = work:</pre>
1340</div>
1341</div>
1342<div class="paragraph">
1343<p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
1344rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p>
1345</div>
1346<div class="paragraph">
1347<p>If you want to rewrite URLs for push only, you can create a
1348configuration section of the form:</p>
1349</div>
1350<div class="verseblock">
1351<pre class="content"> [url "<em>&lt;actual-url-base&gt;</em>"]
1352 pushInsteadOf = <em>&lt;other-url-base&gt;</em></pre>
1353</div>
1354<div class="paragraph">
1355<p>For example, with this:</p>
1356</div>
1357<div class="listingblock">
1358<div class="content">
1359<pre> [url "ssh://example.org/"]
1360 pushInsteadOf = git://example.org/</pre>
1361</div>
1362</div>
1363<div class="paragraph">
1364<p>a URL like "git://example.org/path/to/repo.git" will be rewritten to
1365"ssh://example.org/path/to/repo.git" for pushes, but pulls will still
1366use the original URL.</p>
1367</div>
1368</div>
1369</div>
1370<div class="sect1">
1371<h2 id="_remotes">REMOTES<a id="REMOTES"></a></h2>
1372<div class="sectionbody">
1373<div class="paragraph">
1374<p>The name of one of the following can be used instead
Junio C Hamanodc392382024-10-11 18:57:291375of a URL as <em>&lt;repository&gt;</em> argument:</p>
Junio C Hamanob96f40a2024-08-01 00:57:251376</div>
1377<div class="ulist">
1378<ul>
1379<li>
1380<p>a remote in the Git configuration file: <code>$GIT_DIR/config</code>,</p>
1381</li>
1382<li>
1383<p>a file in the <code>$GIT_DIR/remotes</code> directory, or</p>
1384</li>
1385<li>
1386<p>a file in the <code>$GIT_DIR/branches</code> directory.</p>
1387</li>
1388</ul>
1389</div>
1390<div class="paragraph">
1391<p>All of these also allow you to omit the refspec from the command line
1392because they each contain a refspec which git will use by default.</p>
1393</div>
1394<div class="sect2">
1395<h3 id="_named_remote_in_configuration_file">Named remote in configuration file</h3>
1396<div class="paragraph">
1397<p>You can choose to provide the name of a remote which you had previously
1398configured using <a href="git-remote.html">git-remote(1)</a>, <a href="git-config.html">git-config(1)</a>
1399or even by a manual edit to the <code>$GIT_DIR/config</code> file. The URL of
1400this remote will be used to access the repository. The refspec
1401of this remote will be used by default when you do
1402not provide a refspec on the command line. The entry in the
1403config file would appear like this:</p>
1404</div>
1405<div class="listingblock">
1406<div class="content">
1407<pre> [remote "&lt;name&gt;"]
1408 url = &lt;URL&gt;
1409 pushurl = &lt;pushurl&gt;
1410 push = &lt;refspec&gt;
1411 fetch = &lt;refspec&gt;</pre>
1412</div>
1413</div>
1414<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291415<p>The <em>&lt;pushurl&gt;</em> is used for pushes only. It is optional and defaults
1416to <em>&lt;URL&gt;</em>. Pushing to a remote affects all defined pushurls or all
Junio C Hamanob96f40a2024-08-01 00:57:251417defined urls if no pushurls are defined. Fetch, however, will only
1418fetch from the first defined url if multiple urls are defined.</p>
1419</div>
1420</div>
1421<div class="sect2">
1422<h3 id="_named_file_in_git_dirremotes">Named file in <code>$GIT_DIR/remotes</code></h3>
1423<div class="paragraph">
1424<p>You can choose to provide the name of a
1425file in <code>$GIT_DIR/remotes</code>. The URL
1426in this file will be used to access the repository. The refspec
1427in this file will be used as default when you do not
1428provide a refspec on the command line. This file should have the
1429following format:</p>
1430</div>
1431<div class="listingblock">
1432<div class="content">
1433<pre> URL: one of the above URL formats
1434 Push: &lt;refspec&gt;
1435 Pull: &lt;refspec&gt;</pre>
1436</div>
1437</div>
1438<div class="paragraph">
1439<p><code>Push:</code> lines are used by <em>git push</em> and
1440<code>Pull:</code> lines are used by <em>git pull</em> and <em>git fetch</em>.
1441Multiple <code>Push:</code> and <code>Pull:</code> lines may
1442be specified for additional branch mappings.</p>
1443</div>
1444</div>
1445<div class="sect2">
1446<h3 id="_named_file_in_git_dirbranches">Named file in <code>$GIT_DIR/branches</code></h3>
1447<div class="paragraph">
1448<p>You can choose to provide the name of a
1449file in <code>$GIT_DIR/branches</code>.
1450The URL in this file will be used to access the repository.
1451This file should have the following format:</p>
1452</div>
1453<div class="listingblock">
1454<div class="content">
1455<pre> &lt;URL&gt;#&lt;head&gt;</pre>
1456</div>
1457</div>
1458<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291459<p><em>&lt;URL&gt;</em> is required; #<em>&lt;head&gt;</em> is optional.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251460</div>
1461<div class="paragraph">
1462<p>Depending on the operation, git will use one of the following
1463refspecs, if you don&#8217;t provide one on the command line.
Junio C Hamanodc392382024-10-11 18:57:291464<em>&lt;branch&gt;</em> is the name of this file in <code>$GIT_DIR/branches</code> and
1465<em>&lt;head&gt;</em> defaults to <code>master</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251466</div>
1467<div class="paragraph">
1468<p>git fetch uses:</p>
1469</div>
1470<div class="listingblock">
1471<div class="content">
1472<pre> refs/heads/&lt;head&gt;:refs/heads/&lt;branch&gt;</pre>
1473</div>
1474</div>
1475<div class="paragraph">
1476<p>git push uses:</p>
1477</div>
1478<div class="listingblock">
1479<div class="content">
1480<pre> HEAD:refs/heads/&lt;head&gt;</pre>
1481</div>
1482</div>
1483</div>
1484</div>
1485</div>
1486<div class="sect1">
1487<h2 id="_merge_strategies">MERGE STRATEGIES</h2>
1488<div class="sectionbody">
1489<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291490<p>The merge mechanism (<code>git</code> <code>merge</code> and <code>git</code> <code>pull</code> commands) allows the
Junio C Hamanob96f40a2024-08-01 00:57:251491backend <em>merge strategies</em> to be chosen with <code>-s</code> option. Some strategies
Junio C Hamanodc392382024-10-11 18:57:291492can also take their own options, which can be passed by giving <code>-X</code><em>&lt;option&gt;</em>
1493arguments to <code>git</code> <code>merge</code> and/or <code>git</code> <code>pull</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251494</div>
1495<div class="dlist">
1496<dl>
1497<dt class="hdlist1">ort</dt>
1498<dd>
1499<p>This is the default merge strategy when pulling or merging one
1500branch. This strategy can only resolve two heads using a
15013-way merge algorithm. When there is more than one common
1502ancestor that can be used for 3-way merge, it creates a merged
1503tree of the common ancestors and uses that as the reference
1504tree for the 3-way merge. This has been reported to result in
1505fewer merge conflicts without causing mismerges by tests done
1506on actual merge commits taken from Linux 2.6 kernel
1507development history. Additionally this strategy can detect
1508and handle merges involving renames. It does not make use of
1509detected copies. The name for this algorithm is an acronym
1510("Ostensibly Recursive&#8217;s Twin") and came from the fact that it
1511was written as a replacement for the previous default
1512algorithm, <code>recursive</code>.</p>
1513<div class="paragraph">
1514<p>The <em>ort</em> strategy can take the following options:</p>
1515</div>
1516<div class="dlist">
1517<dl>
1518<dt class="hdlist1">ours</dt>
1519<dd>
1520<p>This option forces conflicting hunks to be auto-resolved cleanly by
1521favoring <em>our</em> version. Changes from the other tree that do not
1522conflict with our side are reflected in the merge result.
1523For a binary file, the entire contents are taken from our side.</p>
1524<div class="paragraph">
1525<p>This should not be confused with the <em>ours</em> merge strategy, which does not
1526even look at what the other tree contains at all. It discards everything
1527the other tree did, declaring <em>our</em> history contains all that happened in it.</p>
1528</div>
1529</dd>
1530<dt class="hdlist1">theirs</dt>
1531<dd>
1532<p>This is the opposite of <em>ours</em>; note that, unlike <em>ours</em>, there is
1533no <em>theirs</em> merge strategy to confuse this merge option with.</p>
1534</dd>
1535<dt class="hdlist1">ignore-space-change</dt>
1536<dt class="hdlist1">ignore-all-space</dt>
1537<dt class="hdlist1">ignore-space-at-eol</dt>
1538<dt class="hdlist1">ignore-cr-at-eol</dt>
1539<dd>
1540<p>Treats lines with the indicated type of whitespace change as
1541unchanged for the sake of a three-way merge. Whitespace
1542changes mixed with other changes to a line are not ignored.
1543See also <a href="git-diff.html">git-diff(1)</a> <code>-b</code>, <code>-w</code>,
1544<code>--ignore-space-at-eol</code>, and <code>--ignore-cr-at-eol</code>.</p>
1545<div class="ulist">
1546<ul>
1547<li>
1548<p>If <em>their</em> version only introduces whitespace changes to a line,
1549<em>our</em> version is used;</p>
1550</li>
1551<li>
1552<p>If <em>our</em> version introduces whitespace changes but <em>their</em>
1553version includes a substantial change, <em>their</em> version is used;</p>
1554</li>
1555<li>
1556<p>Otherwise, the merge proceeds in the usual way.</p>
1557</li>
1558</ul>
1559</div>
1560</dd>
1561<dt class="hdlist1">renormalize</dt>
1562<dd>
1563<p>This runs a virtual check-out and check-in of all three stages
1564of a file when resolving a three-way merge. This option is
1565meant to be used when merging branches with different clean
1566filters or end-of-line normalization rules. See "Merging
1567branches with differing checkin/checkout attributes" in
1568<a href="gitattributes.html">gitattributes(5)</a> for details.</p>
1569</dd>
1570<dt class="hdlist1">no-renormalize</dt>
1571<dd>
1572<p>Disables the <code>renormalize</code> option. This overrides the
1573<code>merge.renormalize</code> configuration variable.</p>
1574</dd>
1575<dt class="hdlist1">find-renames[=&lt;n&gt;]</dt>
1576<dd>
1577<p>Turn on rename detection, optionally setting the similarity
1578threshold. This is the default. This overrides the
1579<em>merge.renames</em> configuration variable.
1580See also <a href="git-diff.html">git-diff(1)</a> <code>--find-renames</code>.</p>
1581</dd>
1582<dt class="hdlist1">rename-threshold=&lt;n&gt;</dt>
1583<dd>
Junio C Hamanodc392382024-10-11 18:57:291584<p>Deprecated synonym for <code>find-renames=</code><em>&lt;n&gt;</em>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251585</dd>
1586<dt class="hdlist1">subtree[=&lt;path&gt;]</dt>
1587<dd>
1588<p>This option is a more advanced form of <em>subtree</em> strategy, where
1589the strategy makes a guess on how two trees must be shifted to
1590match with each other when merging. Instead, the specified path
1591is prefixed (or stripped from the beginning) to make the shape of
1592two trees to match.</p>
1593</dd>
1594</dl>
1595</div>
1596</dd>
1597<dt class="hdlist1">recursive</dt>
1598<dd>
1599<p>This can only resolve two heads using a 3-way merge
1600algorithm. When there is more than one common
1601ancestor that can be used for 3-way merge, it creates a
1602merged tree of the common ancestors and uses that as
1603the reference tree for the 3-way merge. This has been
1604reported to result in fewer merge conflicts without
1605causing mismerges by tests done on actual merge commits
1606taken from Linux 2.6 kernel development history.
1607Additionally this can detect and handle merges involving
1608renames. It does not make use of detected copies. This was
1609the default strategy for resolving two heads from Git v0.99.9k
1610until v2.33.0.</p>
1611<div class="paragraph">
1612<p>The <em>recursive</em> strategy takes the same options as <em>ort</em>. However,
1613there are three additional options that <em>ort</em> ignores (not documented
1614above) that are potentially useful with the <em>recursive</em> strategy:</p>
1615</div>
1616<div class="dlist">
1617<dl>
1618<dt class="hdlist1">patience</dt>
1619<dd>
1620<p>Deprecated synonym for <code>diff-algorithm=patience</code>.</p>
1621</dd>
1622<dt class="hdlist1">diff-algorithm=[patience|minimal|histogram|myers]</dt>
1623<dd>
1624<p>Use a different diff algorithm while merging, which can help
1625avoid mismerges that occur due to unimportant matching lines
1626(such as braces from distinct functions). See also
1627<a href="git-diff.html">git-diff(1)</a> <code>--diff-algorithm</code>. Note that <code>ort</code>
1628specifically uses <code>diff-algorithm=histogram</code>, while <code>recursive</code>
1629defaults to the <code>diff.algorithm</code> config setting.</p>
1630</dd>
1631<dt class="hdlist1">no-renames</dt>
1632<dd>
1633<p>Turn off rename detection. This overrides the <code>merge.renames</code>
1634configuration variable.
1635See also <a href="git-diff.html">git-diff(1)</a> <code>--no-renames</code>.</p>
1636</dd>
1637</dl>
1638</div>
1639</dd>
1640<dt class="hdlist1">resolve</dt>
1641<dd>
1642<p>This can only resolve two heads (i.e. the current branch
1643and another branch you pulled from) using a 3-way merge
1644algorithm. It tries to carefully detect criss-cross
1645merge ambiguities. It does not handle renames.</p>
1646</dd>
1647<dt class="hdlist1">octopus</dt>
1648<dd>
1649<p>This resolves cases with more than two heads, but refuses to do
1650a complex merge that needs manual resolution. It is
1651primarily meant to be used for bundling topic branch
1652heads together. This is the default merge strategy when
1653pulling or merging more than one branch.</p>
1654</dd>
1655<dt class="hdlist1">ours</dt>
1656<dd>
1657<p>This resolves any number of heads, but the resulting tree of the
1658merge is always that of the current branch head, effectively
1659ignoring all changes from all other branches. It is meant to
1660be used to supersede old development history of side
1661branches. Note that this is different from the -Xours option to
1662the <em>recursive</em> merge strategy.</p>
1663</dd>
1664<dt class="hdlist1">subtree</dt>
1665<dd>
1666<p>This is a modified <code>ort</code> strategy. When merging trees A and
1667B, if B corresponds to a subtree of A, B is first adjusted to
1668match the tree structure of A, instead of reading the trees at
1669the same level. This adjustment is also done to the common
1670ancestor tree.</p>
1671</dd>
1672</dl>
1673</div>
1674<div class="paragraph">
1675<p>With the strategies that use 3-way merge (including the default, <em>ort</em>),
1676if a change is made on both branches, but later reverted on one of the
1677branches, that change will be present in the merged result; some people find
1678this behavior confusing. It occurs because only the heads and the merge base
1679are considered when performing a merge, not the individual commits. The merge
1680algorithm therefore considers the reverted change as no change at all, and
1681substitutes the changed version instead.</p>
1682</div>
1683</div>
1684</div>
1685<div class="sect1">
1686<h2 id="_default_behaviour">DEFAULT BEHAVIOUR</h2>
1687<div class="sectionbody">
1688<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291689<p>Often people use <code>git</code> <code>pull</code> without giving any parameter.
1690Traditionally, this has been equivalent to saying <code>git</code> <code>pull</code>
1691<code>origin</code>. However, when configuration <code>branch.</code><em>&lt;name&gt;</em><code>.remote</code> is
1692present while on branch <em>&lt;name&gt;</em>, that value is used instead of
Junio C Hamanob96f40a2024-08-01 00:57:251693<code>origin</code>.</p>
1694</div>
1695<div class="paragraph">
1696<p>In order to determine what URL to use to fetch from, the value
Junio C Hamanodc392382024-10-11 18:57:291697of the configuration <code>remote.</code><em>&lt;origin&gt;</em><code>.url</code> is consulted
Junio C Hamanob96f40a2024-08-01 00:57:251698and if there is not any such variable, the value on the <code>URL:</code> line
Junio C Hamanodc392382024-10-11 18:57:291699in <code>$GIT_DIR/remotes/</code><em>&lt;origin&gt;</em> is used.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251700</div>
1701<div class="paragraph">
1702<p>In order to determine what remote branches to fetch (and
1703optionally store in the remote-tracking branches) when the command is
1704run without any refspec parameters on the command line, values
Junio C Hamanodc392382024-10-11 18:57:291705of the configuration variable <code>remote.</code><em>&lt;origin&gt;</em><code>.fetch</code> are
1706consulted, and if there aren&#8217;t any, <code>$GIT_DIR/remotes/</code><em>&lt;origin&gt;</em>
Junio C Hamanob96f40a2024-08-01 00:57:251707is consulted and its <code>Pull:</code> lines are used.
1708In addition to the refspec formats described in the OPTIONS
1709section, you can have a globbing refspec that looks like this:</p>
1710</div>
1711<div class="listingblock">
1712<div class="content">
1713<pre>refs/heads/*:refs/remotes/origin/*</pre>
1714</div>
1715</div>
1716<div class="paragraph">
1717<p>A globbing refspec must have a non-empty RHS (i.e. must store
1718what were fetched in remote-tracking branches), and its LHS and RHS
Junio C Hamanodc392382024-10-11 18:57:291719must end with <code>/</code>*. The above specifies that all remote
Junio C Hamanob96f40a2024-08-01 00:57:251720branches are tracked using remote-tracking branches in
1721<code>refs/remotes/origin/</code> hierarchy under the same name.</p>
1722</div>
1723<div class="paragraph">
1724<p>The rule to determine which remote branch to merge after
1725fetching is a bit involved, in order not to break backward
1726compatibility.</p>
1727</div>
1728<div class="paragraph">
1729<p>If explicit refspecs were given on the command
Junio C Hamanodc392382024-10-11 18:57:291730line of <code>git</code> <code>pull</code>, they are all merged.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251731</div>
1732<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291733<p>When no refspec was given on the command line, then <code>git</code> <code>pull</code>
Junio C Hamanob96f40a2024-08-01 00:57:251734uses the refspec from the configuration or
Junio C Hamanodc392382024-10-11 18:57:291735<code>$GIT_DIR/remotes/</code><em>&lt;origin&gt;</em>. In such cases, the following
Junio C Hamanob96f40a2024-08-01 00:57:251736rules apply:</p>
1737</div>
1738<div class="olist arabic">
1739<ol class="arabic">
1740<li>
Junio C Hamanodc392382024-10-11 18:57:291741<p>If <code>branch.</code><em>&lt;name&gt;</em><code>.merge</code> configuration for the current
1742branch <em>&lt;name&gt;</em> exists, that is the name of the branch at the
Junio C Hamanob96f40a2024-08-01 00:57:251743remote site that is merged.</p>
1744</li>
1745<li>
1746<p>If the refspec is a globbing one, nothing is merged.</p>
1747</li>
1748<li>
1749<p>Otherwise the remote branch of the first refspec is merged.</p>
1750</li>
1751</ol>
1752</div>
1753</div>
1754</div>
1755<div class="sect1">
1756<h2 id="_examples">EXAMPLES</h2>
1757<div class="sectionbody">
1758<div class="ulist">
1759<ul>
1760<li>
1761<p>Update the remote-tracking branches for the repository
1762you cloned from, then merge one of them into your
1763current branch:</p>
1764<div class="listingblock">
1765<div class="content">
1766<pre>$ git pull
1767$ git pull origin</pre>
1768</div>
1769</div>
1770<div class="paragraph">
1771<p>Normally the branch merged in is the HEAD of the remote repository,
1772but the choice is determined by the branch.&lt;name&gt;.remote and
1773branch.&lt;name&gt;.merge options; see <a href="git-config.html">git-config(1)</a> for details.</p>
1774</div>
1775</li>
1776<li>
1777<p>Merge into the current branch the remote branch <code>next</code>:</p>
1778<div class="listingblock">
1779<div class="content">
1780<pre>$ git pull origin next</pre>
1781</div>
1782</div>
1783<div class="paragraph">
1784<p>This leaves a copy of <code>next</code> temporarily in FETCH_HEAD, and
1785updates the remote-tracking branch <code>origin/next</code>.
1786The same can be done by invoking fetch and merge:</p>
1787</div>
1788<div class="listingblock">
1789<div class="content">
1790<pre>$ git fetch origin
1791$ git merge origin/next</pre>
1792</div>
1793</div>
1794</li>
1795</ul>
1796</div>
1797<div class="paragraph">
1798<p>If you tried a pull which resulted in complex conflicts and
1799would want to start over, you can recover with <em>git reset</em>.</p>
1800</div>
1801</div>
1802</div>
1803<div class="sect1">
1804<h2 id="_security">SECURITY</h2>
1805<div class="sectionbody">
1806<div class="paragraph">
1807<p>The fetch and push protocols are not designed to prevent one side from
1808stealing data from the other repository that was not intended to be
1809shared. If you have private data that you need to protect from a malicious
1810peer, your best option is to store it in another repository. This applies
1811to both clients and servers. In particular, namespaces on a server are not
1812effective for read access control; you should only grant read access to a
1813namespace to clients that you would trust with read access to the entire
1814repository.</p>
1815</div>
1816<div class="paragraph">
1817<p>The known attack vectors are as follows:</p>
1818</div>
1819<div class="olist arabic">
1820<ol class="arabic">
1821<li>
1822<p>The victim sends "have" lines advertising the IDs of objects it has that
1823are not explicitly intended to be shared but can be used to optimize the
1824transfer if the peer also has them. The attacker chooses an object ID X
1825to steal and sends a ref to X, but isn&#8217;t required to send the content of
1826X because the victim already has it. Now the victim believes that the
1827attacker has X, and it sends the content of X back to the attacker
1828later. (This attack is most straightforward for a client to perform on a
1829server, by creating a ref to X in the namespace the client has access
1830to and then fetching it. The most likely way for a server to perform it
1831on a client is to "merge" X into a public branch and hope that the user
1832does additional work on this branch and pushes it back to the server
1833without noticing the merge.)</p>
1834</li>
1835<li>
1836<p>As in #1, the attacker chooses an object ID X to steal. The victim sends
1837an object Y that the attacker already has, and the attacker falsely
1838claims to have X and not Y, so the victim sends Y as a delta against X.
1839The delta reveals regions of X that are similar to Y to the attacker.</p>
1840</li>
1841</ol>
1842</div>
1843</div>
1844</div>
1845<div class="sect1">
1846<h2 id="_bugs">BUGS</h2>
1847<div class="sectionbody">
1848<div class="paragraph">
1849<p>Using --recurse-submodules can only fetch new commits in already checked
1850out submodules right now. When e.g. upstream added a new submodule in the
1851just fetched commits of the superproject the submodule itself cannot be
1852fetched, making it impossible to check out that submodule later without
1853having to do a fetch again. This is expected to be fixed in a future Git
1854version.</p>
1855</div>
1856</div>
1857</div>
1858<div class="sect1">
1859<h2 id="_see_also">SEE ALSO</h2>
1860<div class="sectionbody">
1861<div class="paragraph">
1862<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>
1863</div>
1864</div>
1865</div>
1866<div class="sect1">
1867<h2 id="_git">GIT</h2>
1868<div class="sectionbody">
1869<div class="paragraph">
1870<p>Part of the <a href="git.html">git(1)</a> suite</p>
1871</div>
1872</div>
1873</div>
1874</div>
1875<div id="footer">
1876<div id="footer-text">
1877Last updated 2024-03-25 17:24:49 -0700
1878</div>
1879</div>
1880</body>
1881</html>