blob: f9ae2f7fd1416a231cd4f00611ac3c8d342a0182 [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"/>
Junio C Hamanod6a33e42025-02-18 23:45:117<meta name="generator" content="Asciidoctor 2.0.23"/>
Junio C Hamanob96f40a2024-08-01 00:57:258<title>git-fetch(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}
Junio C Hamanod6a33e42025-02-18 23:45:11143#header>h1:only-child{border-bottom:1px solid #dddddf;padding-bottom:8px}
Junio C Hamanob96f40a2024-08-01 00:57:25144#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}
Junio C Hamanod6a33e42025-02-18 23:45:11165body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
Junio C Hamanob96f40a2024-08-01 00:57:25166#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}
167#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
168#toc.toc2>ul{font-size:.9em;margin-bottom:0}
169#toc.toc2 ul ul{margin-left:0;padding-left:1em}
170#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
171body.toc2.toc-right{padding-left:0;padding-right:15em}
172body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9;left:auto;right:0}}
173@media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
174#toc.toc2{width:20em}
175#toc.toc2 #toctitle{font-size:1.375em}
176#toc.toc2>ul{font-size:.95em}
177#toc.toc2 ul ul{padding-left:1.25em}
178body.toc2.toc-right{padding-left:0;padding-right:20em}}
179#content #toc{border:1px solid #e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;border-radius:4px}
180#content #toc>:first-child{margin-top:0}
181#content #toc>:last-child{margin-bottom:0}
182#footer{max-width:none;background:rgba(0,0,0,.8);padding:1.25em}
183#footer-text{color:hsla(0,0%,100%,.8);line-height:1.44}
184#content{margin-bottom:.625em}
185.sect1{padding-bottom:.625em}
186@media screen and (min-width:768px){#content{margin-bottom:1.25em}
187.sect1{padding-bottom:1.25em}}
188.sect1:last-child{padding-bottom:0}
189.sect1+.sect1{border-top:1px solid #e7e7e9}
190#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}
191#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}
192#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}
193#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}
194#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}
195details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
196details{margin-left:1.25rem}
197details>summary{cursor:pointer;display:block;position:relative;line-height:1.6;margin-bottom:.625rem;outline:none;-webkit-tap-highlight-color:transparent}
198details>summary::-webkit-details-marker{display:none}
199details>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%)}
200details[open]>summary::before{border:solid transparent;border-top:solid;border-width:.5em .3em 0;transform:translateY(15%)}
201details>summary::after{content:"";width:1.25rem;height:1em;position:absolute;top:.3em;left:-1.25rem}
202.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}
203table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
204.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)}
205.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
206.admonitionblock>table td.icon{text-align:center;width:80px}
207.admonitionblock>table td.icon img{max-width:none}
208.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
209.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}
210.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
211.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
212.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
213.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
214.exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
215.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}
216.literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
217@media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
218@media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
219.literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class=highlight],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8}
220.literalblock.output pre{color:#f7f7f8;background:rgba(0,0,0,.9)}
221.listingblock>.content{position:relative}
222.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}
223.listingblock:hover code[data-lang]::before{display:block}
224.listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5}
225.listingblock.terminal pre .command:not([data-prompt])::before{content:"$"}
226.listingblock pre.highlightjs{padding:0}
227.listingblock pre.highlightjs>code{padding:1em;border-radius:4px}
228.listingblock pre.prettyprint{border-width:0}
229.prettyprint{background:#f7f7f8}
230pre.prettyprint .linenums{line-height:1.45;margin-left:2em}
231pre.prettyprint li{background:none;list-style-type:inherit;padding-left:0}
232pre.prettyprint li code[data-lang]::before{opacity:1}
233pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none}
234table.linenotable{border-collapse:separate;border:0;margin-bottom:0;background:none}
235table.linenotable td[class]{color:inherit;vertical-align:top;padding:0;line-height:inherit;white-space:normal}
236table.linenotable td.code{padding-left:.75em}
237table.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}
238pre.pygments span.linenos{display:inline-block;margin-right:.75em}
239.quoteblock{margin:0 1em 1.25em 1.5em;display:table}
240.quoteblock:not(.excerpt)>.title{margin-left:-1.5em;margin-bottom:.75em}
241.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}
242.quoteblock blockquote{margin:0;padding:0;border:0}
243.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)}
244.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
245.quoteblock .attribution{margin-top:.75em;margin-right:.5ex;text-align:right}
246.verseblock{margin:0 1em 1.25em}
247.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}
248.verseblock pre strong{font-weight:400}
249.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
250.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
251.quoteblock .attribution br,.verseblock .attribution br{display:none}
252.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
253.quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none}
254.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}
255.quoteblock.abstract{margin:0 1em 1.25em;display:block}
256.quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center}
257.quoteblock.excerpt>blockquote,.quoteblock .quoteblock{padding:0 0 .25em 1em;border-left:.25em solid #dddddf}
258.quoteblock.excerpt,.quoteblock .quoteblock{margin-left:0}
259.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:1.0625rem}
260.quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;font-size:.85rem;text-align:left;margin-right:0}
261p.tableblock:last-child{margin-bottom:0}
262td.tableblock>.content{margin-bottom:1.25em;word-wrap:anywhere}
263td.tableblock>.content>:last-child{margin-bottom:-1.25em}
264table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
265table.grid-all>*>tr>*{border-width:1px}
266table.grid-cols>*>tr>*{border-width:0 1px}
267table.grid-rows>*>tr>*{border-width:1px 0}
268table.frame-all{border-width:1px}
269table.frame-ends{border-width:1px 0}
270table.frame-sides{border-width:0 1px}
271table.frame-none>colgroup+*>:first-child>*,table.frame-sides>colgroup+*>:first-child>*{border-top-width:0}
272table.frame-none>:last-child>:last-child>*,table.frame-sides>:last-child>:last-child>*{border-bottom-width:0}
273table.frame-none>*>tr>:first-child,table.frame-ends>*>tr>:first-child{border-left-width:0}
274table.frame-none>*>tr>:last-child,table.frame-ends>*>tr>:last-child{border-right-width:0}
275table.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}
276th.halign-left,td.halign-left{text-align:left}
277th.halign-right,td.halign-right{text-align:right}
278th.halign-center,td.halign-center{text-align:center}
279th.valign-top,td.valign-top{vertical-align:top}
280th.valign-bottom,td.valign-bottom{vertical-align:bottom}
281th.valign-middle,td.valign-middle{vertical-align:middle}
282table thead th,table tfoot th{font-weight:bold}
283tbody tr th{background:#f7f8f7}
284tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
285p.tableblock>code:only-child{background:none;padding:0}
286p.tableblock{font-size:1em}
287ol{margin-left:1.75em}
288ul li ol{margin-left:1.5em}
289dl dd{margin-left:1.125em}
290dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
291li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
292ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
293ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em}
294ul.unstyled,ol.unstyled{margin-left:0}
295li>p:empty:only-child::before{content:"";display:inline-block}
296ul.checklist>li>p:first-child{margin-left:-1em}
297ul.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}
298ul.checklist>li>p:first-child>input[type=checkbox]:first-child{margin-right:.25em}
299ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em}
300ul.inline>li{margin-left:1.25em}
301.unstyled dl dt{font-weight:400;font-style:normal}
302ol.arabic{list-style-type:decimal}
303ol.decimal{list-style-type:decimal-leading-zero}
304ol.loweralpha{list-style-type:lower-alpha}
305ol.upperalpha{list-style-type:upper-alpha}
306ol.lowerroman{list-style-type:lower-roman}
307ol.upperroman{list-style-type:upper-roman}
308ol.lowergreek{list-style-type:lower-greek}
309.hdlist>table,.colist>table{border:0;background:none}
310.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
311td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
312td.hdlist1{font-weight:bold;padding-bottom:1.25em}
313td.hdlist2{word-wrap:anywhere}
314.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
315.colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top}
316.colist td:not([class]):first-child img{max-width:none}
317.colist td:not([class]):last-child{padding:.25em 0}
318.thumb,.th{line-height:0;display:inline-block;border:4px solid #fff;box-shadow:0 0 0 1px #ddd}
319.imageblock.left{margin:.25em .625em 1.25em 0}
320.imageblock.right{margin:.25em 0 1.25em .625em}
321.imageblock>.title{margin-bottom:0}
322.imageblock.thumb,.imageblock.th{border-width:6px}
323.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
324.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
325.image.left{margin-right:.625em}
326.image.right{margin-left:.625em}
327a.image{text-decoration:none;display:inline-block}
328a.image object{pointer-events:none}
329sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
330sup.footnote a,sup.footnoteref a{text-decoration:none}
Junio C Hamanod6a33e42025-02-18 23:45:11331sup.footnote a:active,sup.footnoteref a:active,#footnotes .footnote a:first-of-type:active{text-decoration:underline}
Junio C Hamanob96f40a2024-08-01 00:57:25332#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
333#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
334#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
335#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em}
336#footnotes .footnote:last-of-type{margin-bottom:0}
337#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
338div.unbreakable{page-break-inside:avoid}
339.big{font-size:larger}
340.small{font-size:smaller}
341.underline{text-decoration:underline}
342.overline{text-decoration:overline}
343.line-through{text-decoration:line-through}
344.aqua{color:#00bfbf}
345.aqua-background{background:#00fafa}
346.black{color:#000}
347.black-background{background:#000}
348.blue{color:#0000bf}
349.blue-background{background:#0000fa}
350.fuchsia{color:#bf00bf}
351.fuchsia-background{background:#fa00fa}
352.gray{color:#606060}
353.gray-background{background:#7d7d7d}
354.green{color:#006000}
355.green-background{background:#007d00}
356.lime{color:#00bf00}
357.lime-background{background:#00fa00}
358.maroon{color:#600000}
359.maroon-background{background:#7d0000}
360.navy{color:#000060}
361.navy-background{background:#00007d}
362.olive{color:#606000}
363.olive-background{background:#7d7d00}
364.purple{color:#600060}
365.purple-background{background:#7d007d}
366.red{color:#bf0000}
367.red-background{background:#fa0000}
368.silver{color:#909090}
369.silver-background{background:#bcbcbc}
370.teal{color:#006060}
371.teal-background{background:#007d7d}
372.white{color:#bfbfbf}
373.white-background{background:#fafafa}
374.yellow{color:#bfbf00}
375.yellow-background{background:#fafa00}
376span.icon>.fa{cursor:default}
377a span.icon>.fa{cursor:inherit}
378.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
379.admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c}
380.admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
381.admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900}
382.admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400}
383.admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000}
384.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}
385.conum[data-value] *{color:#fff!important}
386.conum[data-value]+b{display:none}
387.conum[data-value]::after{content:attr(data-value)}
388pre .conum[data-value]{position:relative;top:-.125em}
389b.conum *{color:inherit!important}
390.conum:not([data-value]):empty{display:none}
391dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
392h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
393p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
394p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
395p{margin-bottom:1.25rem}
396.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
397.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
398.print-only{display:none!important}
399@page{margin:1.25cm .75cm}
400@media print{*{box-shadow:none!important;text-shadow:none!important}
401html{font-size:80%}
402a{color:inherit!important;text-decoration:underline!important}
403a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
404a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
405abbr[title]{border-bottom:1px dotted}
406abbr[title]::after{content:" (" attr(title) ")"}
407pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
408thead{display:table-header-group}
409svg{max-width:100%}
410p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
411h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
412#header,#content,#footnotes,#footer{max-width:none}
413#toc,.sidebarblock,.exampleblock>.content{background:none!important}
414#toc{border-bottom:1px solid #dddddf!important;padding-bottom:0!important}
415body.book #header{text-align:center}
416body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em}
417body.book #header .details{border:0!important;display:block;padding:0!important}
418body.book #header .details span:first-child{margin-left:0!important}
419body.book #header .details br{display:block}
420body.book #header .details br+span::before{content:none!important}
421body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
422body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
423.listingblock code[data-lang]::before{display:block}
424#footer{padding:0 .9375em}
425.hide-on-print{display:none!important}
426.print-only{display:block!important}
427.hide-for-print{display:none!important}
428.show-for-print{display:inherit!important}}
429@media amzn-kf8,print{#header>h1:first-child{margin-top:1.25rem}
430.sect1{padding:0!important}
431.sect1+.sect1{border:0}
432#footer{background:none}
433#footer-text{color:rgba(0,0,0,.6);font-size:.9em}}
434@media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}}
435</style>
436<style>
437pre>code {
438 display: inline;
439}
440</style>
441</head>
442<body class="manpage">
443<div id="header">
444<h1>git-fetch(1) Manual Page</h1>
445<h2 id="_name">NAME</h2>
446<div class="sectionbody">
447<p>git-fetch - Download objects and refs from another repository</p>
448</div>
449</div>
450<div id="content">
451<div class="sect1">
452<h2 id="_synopsis">SYNOPSIS</h2>
453<div class="sectionbody">
454<div class="verseblock">
455<pre class="content"><em>git fetch</em> [&lt;options&gt;] [&lt;repository&gt; [&lt;refspec&gt;&#8230;&#8203;]]
456<em>git fetch</em> [&lt;options&gt;] &lt;group&gt;
457<em>git fetch</em> --multiple [&lt;options&gt;] [(&lt;repository&gt; | &lt;group&gt;)&#8230;&#8203;]
458<em>git fetch</em> --all [&lt;options&gt;]</pre>
459</div>
460</div>
461</div>
462<div class="sect1">
463<h2 id="_description">DESCRIPTION</h2>
464<div class="sectionbody">
465<div class="paragraph">
466<p>Fetch branches and/or tags (collectively, "refs") from one or more
467other repositories, along with the objects necessary to complete their
468histories. Remote-tracking branches are updated (see the description
469of &lt;refspec&gt; below for ways to control this behavior).</p>
470</div>
471<div class="paragraph">
472<p>By default, any tag that points into the histories being fetched is
473also fetched; the effect is to fetch tags that
474point at branches that you are interested in. This default behavior
475can be changed by using the --tags or --no-tags options or by
476configuring remote.&lt;name&gt;.tagOpt. By using a refspec that fetches tags
477explicitly, you can fetch tags that do not point into branches you
478are interested in as well.</p>
479</div>
480<div class="paragraph">
481<p><em>git fetch</em> can fetch from either a single named repository or URL,
482or from several repositories at once if &lt;group&gt; is given and
483there is a remotes.&lt;group&gt; entry in the configuration file.
484(See <a href="git-config.html">git-config(1)</a>).</p>
485</div>
486<div class="paragraph">
487<p>When no remote is specified, by default the <code>origin</code> remote will be used,
488unless there&#8217;s an upstream branch configured for the current branch.</p>
489</div>
490<div class="paragraph">
491<p>The names of refs that are fetched, together with the object names
Junio C Hamanodc392382024-10-11 18:57:29492they point at, are written to .<code>git/FETCH_HEAD</code>. This information
Junio C Hamanob96f40a2024-08-01 00:57:25493may be used by scripts or other git commands, such as <a href="git-pull.html">git-pull(1)</a>.</p>
494</div>
495</div>
496</div>
497<div class="sect1">
498<h2 id="_options">OPTIONS</h2>
499<div class="sectionbody">
500<div class="dlist">
501<dl>
502<dt class="hdlist1">--[no-]all</dt>
503<dd>
Junio C Hamano210f01b2024-09-14 16:10:50504<p>Fetch all remotes, except for the ones that has the
Junio C Hamanodc392382024-10-11 18:57:29505<code>remote.</code><em>&lt;name&gt;</em><code>.skipFetchAll</code> configuration variable set.
Junio C Hamano210f01b2024-09-14 16:10:50506This overrides the configuration variable fetch.all`.</p>
Junio C Hamanob96f40a2024-08-01 00:57:25507</dd>
508<dt class="hdlist1">-a</dt>
509<dt class="hdlist1">--append</dt>
510<dd>
511<p>Append ref names and object names of fetched refs to the
Junio C Hamanodc392382024-10-11 18:57:29512existing contents of .<code>git/FETCH_HEAD</code>. Without this
513option old data in .<code>git/FETCH_HEAD</code> will be overwritten.</p>
Junio C Hamanob96f40a2024-08-01 00:57:25514</dd>
515<dt class="hdlist1">--atomic</dt>
516<dd>
517<p>Use an atomic transaction to update local refs. Either all refs are
518updated, or on error, no refs are updated.</p>
519</dd>
520<dt class="hdlist1">--depth=&lt;depth&gt;</dt>
521<dd>
522<p>Limit fetching to the specified number of commits from the tip of
523each remote branch history. If fetching to a <em>shallow</em> repository
Junio C Hamanodc392382024-10-11 18:57:29524created 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:25525<a href="git-clone.html">git-clone(1)</a>), deepen or shorten the history to the specified
526number of commits. Tags for the deepened commits are not fetched.</p>
527</dd>
528<dt class="hdlist1">--deepen=&lt;depth&gt;</dt>
529<dd>
530<p>Similar to --depth, except it specifies the number of commits
531from the current shallow boundary instead of from the tip of
532each remote branch history.</p>
533</dd>
534<dt class="hdlist1">--shallow-since=&lt;date&gt;</dt>
535<dd>
536<p>Deepen or shorten the history of a shallow repository to
537include all reachable commits after &lt;date&gt;.</p>
538</dd>
Junio C Hamano5b4b3d82024-11-16 08:04:51539<dt class="hdlist1">--shallow-exclude=&lt;ref&gt;</dt>
Junio C Hamanob96f40a2024-08-01 00:57:25540<dd>
541<p>Deepen or shorten the history of a shallow repository to
542exclude commits reachable from a specified remote branch or tag.
543This option can be specified multiple times.</p>
544</dd>
545<dt class="hdlist1">--unshallow</dt>
546<dd>
547<p>If the source repository is complete, convert a shallow
548repository to a complete one, removing all the limitations
549imposed by shallow repositories.</p>
550<div class="paragraph">
551<p>If the source repository is shallow, fetch as much as possible so that
552the current repository has the same history as the source repository.</p>
553</div>
554</dd>
555<dt class="hdlist1">--update-shallow</dt>
556<dd>
557<p>By default when fetching from a shallow repository,
Junio C Hamanodc392382024-10-11 18:57:29558<code>git</code> <code>fetch</code> refuses refs that require updating
Junio C Hamanob96f40a2024-08-01 00:57:25559.git/shallow. This option updates .git/shallow and accepts such
560refs.</p>
561</dd>
562<dt class="hdlist1">--negotiation-tip=&lt;commit|glob&gt;</dt>
563<dd>
564<p>By default, Git will report, to the server, commits reachable
565from all local refs to find common commits in an attempt to
566reduce the size of the to-be-received packfile. If specified,
567Git will only report commits reachable from the given tips.
568This is useful to speed up fetches when the user knows which
569local ref is likely to have commits in common with the
570upstream ref being fetched.</p>
571<div class="paragraph">
572<p>This option may be specified more than once; if so, Git will report
573commits reachable from any of the given commits.</p>
574</div>
575<div class="paragraph">
576<p>The argument to this option may be a glob on ref names, a ref, or the (possibly
577abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying
578this option multiple times, one for each matching ref name.</p>
579</div>
580<div class="paragraph">
581<p>See also the <code>fetch.negotiationAlgorithm</code> and <code>push.negotiate</code>
582configuration variables documented in <a href="git-config.html">git-config(1)</a>, and the
583<code>--negotiate-only</code> option below.</p>
584</div>
585</dd>
586<dt class="hdlist1">--negotiate-only</dt>
587<dd>
588<p>Do not fetch anything from the server, and instead print the
Junio C Hamanoe03f5992025-04-23 22:24:29589ancestors of the provided <code>--negotiation-tip=*</code> arguments,
Junio C Hamanob96f40a2024-08-01 00:57:25590which we have in common with the server.</p>
591<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:29592<p>This is incompatible with <code>--recurse-submodules=</code>[<code>yes</code>|<code>on-demand</code>].
Junio C Hamanob96f40a2024-08-01 00:57:25593Internally this is used to implement the <code>push.negotiate</code> option, see
594<a href="git-config.html">git-config(1)</a>.</p>
595</div>
596</dd>
597<dt class="hdlist1">--dry-run</dt>
598<dd>
599<p>Show what would be done, without making any changes.</p>
600</dd>
601<dt class="hdlist1">--porcelain</dt>
602<dd>
603<p>Print the output to standard output in an easy-to-parse format for
604scripts. See section OUTPUT in <a href="git-fetch.html">git-fetch(1)</a> for details.</p>
605<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:29606<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:25607precedence over the <code>fetch.output</code> config option.</p>
608</div>
609</dd>
610<dt class="hdlist1">--[no-]write-fetch-head</dt>
611<dd>
612<p>Write the list of remote refs fetched in the <code>FETCH_HEAD</code>
613file directly under <code>$GIT_DIR</code>. This is the default.
614Passing <code>--no-write-fetch-head</code> from the command line tells
615Git not to write the file. Under <code>--dry-run</code> option, the
616file is never written.</p>
617</dd>
618<dt class="hdlist1">-f</dt>
619<dt class="hdlist1">--force</dt>
620<dd>
Junio C Hamanodc392382024-10-11 18:57:29621<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:25622refuse to update the local branch as discussed
Junio C Hamanodc392382024-10-11 18:57:29623in the <em>&lt;refspec&gt;</em> part below.
Junio C Hamanob96f40a2024-08-01 00:57:25624This option overrides that check.</p>
625</dd>
626<dt class="hdlist1">-k</dt>
627<dt class="hdlist1">--keep</dt>
628<dd>
629<p>Keep downloaded pack.</p>
630</dd>
631<dt class="hdlist1">--multiple</dt>
632<dd>
633<p>Allow several &lt;repository&gt; and &lt;group&gt; arguments to be
634specified. No &lt;refspec&gt;s may be specified.</p>
635</dd>
636<dt class="hdlist1">--[no-]auto-maintenance</dt>
637<dt class="hdlist1">--[no-]auto-gc</dt>
638<dd>
Junio C Hamanodc392382024-10-11 18:57:29639<p>Run <code>git</code> <code>maintenance</code> <code>run</code> <code>--auto</code> at the end to perform automatic
640repository maintenance if needed. (<code>--</code>[<code>no-</code>]<code>auto-gc</code> is a synonym.)
Junio C Hamanob96f40a2024-08-01 00:57:25641This is enabled by default.</p>
642</dd>
643<dt class="hdlist1">--[no-]write-commit-graph</dt>
644<dd>
645<p>Write a commit-graph after fetching. This overrides the config
646setting <code>fetch.writeCommitGraph</code>.</p>
647</dd>
648<dt class="hdlist1">--prefetch</dt>
649<dd>
650<p>Modify the configured refspec to place all refs into the
651<code>refs/prefetch/</code> namespace. See the <code>prefetch</code> task in
652<a href="git-maintenance.html">git-maintenance(1)</a>.</p>
653</dd>
654<dt class="hdlist1">-p</dt>
655<dt class="hdlist1">--prune</dt>
656<dd>
657<p>Before fetching, remove any remote-tracking references that no
658longer exist on the remote. Tags are not subject to pruning
659if they are fetched only because of the default tag
660auto-following or due to a --tags option. However, if tags
661are fetched due to an explicit refspec (either on the command
662line or in the remote configuration, for example if the remote
663was cloned with the --mirror option), then they are also
664subject to pruning. Supplying <code>--prune-tags</code> is a shorthand for
665providing the tag refspec.</p>
666<div class="paragraph">
667<p>See the PRUNING section below for more details.</p>
668</div>
669</dd>
670<dt class="hdlist1">-P</dt>
671<dt class="hdlist1">--prune-tags</dt>
672<dd>
673<p>Before fetching, remove any local tags that no longer exist on
674the remote if <code>--prune</code> is enabled. This option should be used
675more carefully, unlike <code>--prune</code> it will remove any local
676references (local tags) that have been created. This option is
677a shorthand for providing the explicit tag refspec along with
678<code>--prune</code>, see the discussion about that in its documentation.</p>
679<div class="paragraph">
680<p>See the PRUNING section below for more details.</p>
681</div>
682</dd>
683<dt class="hdlist1">-n</dt>
684<dt class="hdlist1">--no-tags</dt>
685<dd>
686<p>By default, tags that point at objects that are downloaded
687from the remote repository are fetched and stored locally.
688This option disables this automatic tag following. The default
689behavior for a remote may be specified with the remote.&lt;name&gt;.tagOpt
690setting. See <a href="git-config.html">git-config(1)</a>.</p>
691</dd>
692<dt class="hdlist1">--refetch</dt>
693<dd>
694<p>Instead of negotiating with the server to avoid transferring commits and
695associated objects that are already present locally, this option fetches
696all objects as a fresh clone would. Use this to reapply a partial clone
697filter from configuration or using <code>--filter=</code> when the filter
698definition has changed. Automatic post-fetch maintenance will perform
699object database pack consolidation to remove any duplicate objects.</p>
700</dd>
701<dt class="hdlist1">--refmap=&lt;refspec&gt;</dt>
702<dd>
703<p>When fetching refs listed on the command line, use the
704specified refspec (can be given more than once) to map the
705refs to remote-tracking branches, instead of the values of
Junio C Hamanoe03f5992025-04-23 22:24:29706<code>remote.*.fetch</code> configuration variables for the remote
Junio C Hamanodc392382024-10-11 18:57:29707repository. Providing an empty <em>&lt;refspec&gt;</em> to the
Junio C Hamanob96f40a2024-08-01 00:57:25708<code>--refmap</code> option causes Git to ignore the configured
709refspecs and rely entirely on the refspecs supplied as
710command-line arguments. See section on "Configured Remote-tracking
711Branches" for details.</p>
712</dd>
713<dt class="hdlist1">-t</dt>
714<dt class="hdlist1">--tags</dt>
715<dd>
716<p>Fetch all tags from the remote (i.e., fetch remote tags
Junio C Hamanoe03f5992025-04-23 22:24:29717<code>refs/tags/*</code> into local tags with the same name), in addition
Junio C Hamanob96f40a2024-08-01 00:57:25718to whatever else would otherwise be fetched. Using this
719option alone does not subject tags to pruning, even if --prune
720is used (though tags may be pruned anyway if they are also the
721destination of an explicit refspec; see <code>--prune</code>).</p>
722</dd>
723<dt class="hdlist1">--recurse-submodules[=(yes|on-demand|no)]</dt>
724<dd>
725<p>This option controls if and under what conditions new commits of
726submodules should be fetched too. When recursing through submodules,
Junio C Hamanodc392382024-10-11 18:57:29727<code>git</code> <code>fetch</code> always attempts to fetch "changed" submodules, that is, a
Junio C Hamanob96f40a2024-08-01 00:57:25728submodule that has commits that are referenced by a newly fetched
729superproject commit but are missing in the local submodule clone. A
730changed submodule can be fetched as long as it is present locally e.g.
731in <code>$GIT_DIR/modules/</code> (see <a href="gitsubmodules.html">gitsubmodules(7)</a>); if the upstream
732adds a new submodule, that submodule cannot be fetched until it is
Junio C Hamanodc392382024-10-11 18:57:29733cloned e.g. by <code>git</code> <code>submodule</code> <code>update</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:25734<div class="paragraph">
735<p>When set to <em>on-demand</em>, only changed submodules are fetched. When set
736to <em>yes</em>, all populated submodules are fetched and submodules that are
737both unpopulated and changed are fetched. When set to <em>no</em>, submodules
738are never fetched.</p>
739</div>
740<div class="paragraph">
741<p>When unspecified, this uses the value of <code>fetch.recurseSubmodules</code> if it
742is set (see <a href="git-config.html">git-config(1)</a>), defaulting to <em>on-demand</em> if unset.
743When this option is used without any value, it defaults to <em>yes</em>.</p>
744</div>
745</dd>
746<dt class="hdlist1">-j</dt>
747<dt class="hdlist1">--jobs=&lt;n&gt;</dt>
748<dd>
749<p>Number of parallel children to be used for all forms of fetching.</p>
750<div class="paragraph">
751<p>If the <code>--multiple</code> option was specified, the different remotes will be fetched
752in parallel. If multiple submodules are fetched, they will be fetched in
753parallel. To control them independently, use the config settings
754<code>fetch.parallel</code> and <code>submodule.fetchJobs</code> (see <a href="git-config.html">git-config(1)</a>).</p>
755</div>
756<div class="paragraph">
757<p>Typically, parallel recursive and multi-remote fetches will be faster. By
758default fetches are performed sequentially, not in parallel.</p>
759</div>
760</dd>
761<dt class="hdlist1">--no-recurse-submodules</dt>
762<dd>
763<p>Disable recursive fetching of submodules (this has the same effect as
764using the <code>--recurse-submodules=no</code> option).</p>
765</dd>
766<dt class="hdlist1">--set-upstream</dt>
767<dd>
768<p>If the remote is fetched successfully, add upstream
769(tracking) reference, used by argument-less
770<a href="git-pull.html">git-pull(1)</a> and other commands. For more information,
Junio C Hamanodc392382024-10-11 18:57:29771see <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:25772<a href="git-config.html">git-config(1)</a>.</p>
773</dd>
774<dt class="hdlist1">--submodule-prefix=&lt;path&gt;</dt>
775<dd>
776<p>Prepend &lt;path&gt; to paths printed in informative messages
777such as "Fetching submodule foo". This option is used
778internally when recursing over submodules.</p>
779</dd>
780<dt class="hdlist1">--recurse-submodules-default=[yes|on-demand]</dt>
781<dd>
782<p>This option is used internally to temporarily provide a
783non-negative default value for the --recurse-submodules
784option. All other methods of configuring fetch&#8217;s submodule
785recursion (such as settings in <a href="gitmodules.html">gitmodules(5)</a> and
786<a href="git-config.html">git-config(1)</a>) override this option, as does
787specifying --[no-]recurse-submodules directly.</p>
788</dd>
789<dt class="hdlist1">-u</dt>
790<dt class="hdlist1">--update-head-ok</dt>
791<dd>
792<p>By default <em>git fetch</em> refuses to update the head which
793corresponds to the current branch. This flag disables the
794check. This is purely for the internal use for <em>git pull</em>
795to communicate with <em>git fetch</em>, and unless you are
796implementing your own Porcelain you are not supposed to
797use it.</p>
798</dd>
799<dt class="hdlist1">--upload-pack &lt;upload-pack&gt;</dt>
800<dd>
801<p>When given, and the repository to fetch from is handled
Junio C Hamanodc392382024-10-11 18:57:29802by <em>git fetch-pack</em>, <code>--exec=</code><em>&lt;upload-pack&gt;</em> is passed to
Junio C Hamanob96f40a2024-08-01 00:57:25803the command to specify non-default path for the command
804run on the other end.</p>
805</dd>
806<dt class="hdlist1">-q</dt>
807<dt class="hdlist1">--quiet</dt>
808<dd>
809<p>Pass --quiet to git-fetch-pack and silence any other internally
810used git commands. Progress is not reported to the standard error
811stream.</p>
812</dd>
813<dt class="hdlist1">-v</dt>
814<dt class="hdlist1">--verbose</dt>
815<dd>
816<p>Be verbose.</p>
817</dd>
818<dt class="hdlist1">--progress</dt>
819<dd>
820<p>Progress status is reported on the standard error stream
821by default when it is attached to a terminal, unless -q
822is specified. This flag forces progress status even if the
823standard error stream is not directed to a terminal.</p>
824</dd>
825<dt class="hdlist1">-o &lt;option&gt;</dt>
826<dt class="hdlist1">--server-option=&lt;option&gt;</dt>
827<dd>
828<p>Transmit the given string to the server when communicating using
829protocol version 2. The given string must not contain a NUL or LF
830character. The server&#8217;s handling of server options, including
831unknown ones, is server-specific.
Junio C Hamanodc392382024-10-11 18:57:29832When multiple <code>--server-option=</code><em>&lt;option&gt;</em> are given, they are all
Junio C Hamanof4e4f532024-11-02 05:48:11833sent to the other side in the order listed on the command line.
834When no <code>--server-option=</code><em>&lt;option&gt;</em> is given from the command line,
835the values of configuration variable <code>remote.</code><em>&lt;name&gt;</em><code>.serverOption</code>
836are used instead.</p>
Junio C Hamanob96f40a2024-08-01 00:57:25837</dd>
838<dt class="hdlist1">--show-forced-updates</dt>
839<dd>
840<p>By default, git checks if a branch is force-updated during
841fetch. This can be disabled through fetch.showForcedUpdates, but
842the --show-forced-updates option guarantees this check occurs.
843See <a href="git-config.html">git-config(1)</a>.</p>
844</dd>
845<dt class="hdlist1">--no-show-forced-updates</dt>
846<dd>
847<p>By default, git checks if a branch is force-updated during
848fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates
849to false to skip this check for performance reasons. If used during
850<em>git-pull</em> the --ff-only option will still check for forced updates
851before attempting a fast-forward update. See <a href="git-config.html">git-config(1)</a>.</p>
852</dd>
853<dt class="hdlist1">-4</dt>
854<dt class="hdlist1">--ipv4</dt>
855<dd>
856<p>Use IPv4 addresses only, ignoring IPv6 addresses.</p>
857</dd>
858<dt class="hdlist1">-6</dt>
859<dt class="hdlist1">--ipv6</dt>
860<dd>
861<p>Use IPv6 addresses only, ignoring IPv4 addresses.</p>
862</dd>
863<dt class="hdlist1">&lt;repository&gt;</dt>
864<dd>
865<p>The "remote" repository that is the source of a fetch
866or pull operation. This parameter can be either a URL
867(see the section <a href="#URLS">GIT URLS</a> below) or the name
868of a remote (see the section <a href="#REMOTES">REMOTES</a> below).</p>
869</dd>
870<dt class="hdlist1">&lt;group&gt;</dt>
871<dd>
872<p>A name referring to a list of repositories as the value
873of remotes.&lt;group&gt; in the configuration file.
874(See <a href="git-config.html">git-config(1)</a>).</p>
875</dd>
876<dt class="hdlist1">&lt;refspec&gt;</dt>
877<dd>
878<p>Specifies which refs to fetch and which local refs to update.
879When no &lt;refspec&gt;s appear on the command line, the refs to fetch
Junio C Hamanodc392382024-10-11 18:57:29880are read from <code>remote.</code><em>&lt;repository&gt;</em><code>.fetch</code> variables instead
Junio C Hamanob96f40a2024-08-01 00:57:25881(see <a href="#CRTB">CONFIGURED REMOTE-TRACKING BRANCHES</a> below).</p>
882<div class="paragraph">
883<p>The format of a &lt;refspec&gt; parameter is an optional plus
884<code>+</code>, followed by the source &lt;src&gt;, followed
Junio C Hamanof4e4f532024-11-02 05:48:11885by a colon <code>:</code>, followed by the destination &lt;dst&gt;.
Junio C Hamanob96f40a2024-08-01 00:57:25886The colon can be omitted when &lt;dst&gt; is empty. &lt;src&gt; is
Junio C Hamanoe03f5992025-04-23 22:24:29887typically a ref, or a glob pattern with a single <code>*</code> that is used
Junio C Hamanof4e4f532024-11-02 05:48:11888to match a set of refs, but it can also be a fully spelled hex object
Junio C Hamanob96f40a2024-08-01 00:57:25889name.</p>
890</div>
891<div class="paragraph">
Junio C Hamanoe03f5992025-04-23 22:24:29892<p>A &lt;refspec&gt; may contain a <code>*</code> in its &lt;src&gt; to indicate a simple pattern
Junio C Hamanob96f40a2024-08-01 00:57:25893match. Such a refspec functions like a glob that matches any ref with the
Junio C Hamanoe03f5992025-04-23 22:24:29894pattern. A pattern &lt;refspec&gt; must have one and only one <code>*</code> in both the &lt;src&gt; and
895&lt;dst&gt;. It will map refs to the destination by replacing the <code>*</code> with the
Junio C Hamanob96f40a2024-08-01 00:57:25896contents matched from the source.</p>
897</div>
898<div class="paragraph">
899<p>If a refspec is prefixed by <code>^</code>, it will be interpreted as a negative
900refspec. Rather than specifying which refs to fetch or which local refs to
901update, such a refspec will instead specify refs to exclude. A ref will be
902considered to match if it matches at least one positive refspec, and does
903not match any negative refspec. Negative refspecs can be useful to restrict
904the scope of a pattern refspec so that it will not include specific refs.
905Negative refspecs can themselves be pattern refspecs. However, they may only
906contain a &lt;src&gt; and do not specify a &lt;dst&gt;. Fully spelled out hex object
907names are also not supported.</p>
908</div>
909<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:29910<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:25911it requests fetching everything up to the given tag.</p>
912</div>
913<div class="paragraph">
914<p>The remote ref that matches &lt;src&gt;
915is fetched, and if &lt;dst&gt; is not an empty string, an attempt
916is made to update the local ref that matches it.</p>
917</div>
918<div class="paragraph">
919<p>Whether that update is allowed without <code>--force</code> depends on the ref
920namespace it&#8217;s being fetched to, the type of object being fetched, and
921whether the update is considered to be a fast-forward. Generally, the
Junio C Hamanodc392382024-10-11 18:57:29922same rules apply for fetching as when pushing, see the <em>&lt;refspec&gt;</em>...
Junio C Hamanob96f40a2024-08-01 00:57:25923section of <a href="git-push.html">git-push(1)</a> for what those are. Exceptions to those
924rules particular to <em>git fetch</em> are noted below.</p>
925</div>
926<div class="paragraph">
927<p>Until Git version 2.20, and unlike when pushing with
Junio C Hamanoe03f5992025-04-23 22:24:29928<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:25929without <code>+</code> in the refspec (or <code>--force</code>). When fetching, we promiscuously
930considered all tag updates from a remote to be forced fetches. Since
Junio C Hamanoe03f5992025-04-23 22:24:29931Git version 2.20, fetching to update <code>refs/tags/*</code> works the same way
Junio C Hamanob96f40a2024-08-01 00:57:25932as when pushing. I.e. any updates will be rejected without <code>+</code> in the
933refspec (or <code>--force</code>).</p>
934</div>
935<div class="paragraph">
936<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:29937<code>refs/</code>{tags,heads}/* will be accepted without <code>+</code> in the refspec (or
Junio C Hamanob96f40a2024-08-01 00:57:25938<code>--force</code>), whether that&#8217;s swapping e.g. a tree object for a blob, or
939a commit for another commit that doesn&#8217;t have the previous commit as
940an ancestor etc.</p>
941</div>
942<div class="paragraph">
943<p>Unlike when pushing with <a href="git-push.html">git-push(1)</a>, there is no
944configuration which&#8217;ll amend these rules, and nothing like a
945<code>pre-fetch</code> hook analogous to the <code>pre-receive</code> hook.</p>
946</div>
947<div class="paragraph">
948<p>As with pushing with <a href="git-push.html">git-push(1)</a>, all of the rules described
949above about what&#8217;s not allowed as an update can be overridden by
950adding an optional leading <code>+</code> to a refspec (or using the <code>--force</code>
951command line option). The only exception to this is that no amount of
Junio C Hamanoe03f5992025-04-23 22:24:29952forcing will make the <code>refs/heads/*</code> namespace accept a non-commit
Junio C Hamanob96f40a2024-08-01 00:57:25953object.</p>
954</div>
955<div class="admonitionblock note">
956<table>
957<tr>
958<td class="icon">
959<div class="title">Note</div>
960</td>
961<td class="content">
962When the remote branch you want to fetch is known to
963be rewound and rebased regularly, it is expected that
964its new tip will not be a descendant of its previous tip
965(as stored in your remote-tracking branch the last time
966you fetched). You would want
967to use the <code>+</code> sign to indicate non-fast-forward updates
968will be needed for such branches. There is no way to
969determine or declare that a branch will be made available
970in a repository with this behavior; the pulling user simply
971must know this is the expected usage pattern for a branch.
972</td>
973</tr>
974</table>
975</div>
976</dd>
977<dt class="hdlist1">--stdin</dt>
978<dd>
979<p>Read refspecs, one per line, from stdin in addition to those provided
980as arguments. The "tag &lt;name&gt;" format is not supported.</p>
981</dd>
982</dl>
983</div>
984</div>
985</div>
986<div class="sect1">
987<h2 id="_git_urls">GIT URLS<a id="URLS"></a></h2>
988<div class="sectionbody">
989<div class="paragraph">
990<p>In general, URLs contain information about the transport protocol, the
991address of the remote server, and the path to the repository.
992Depending on the transport protocol, some of this information may be
993absent.</p>
994</div>
995<div class="paragraph">
996<p>Git supports ssh, git, http, and https protocols (in addition, ftp
997and ftps can be used for fetching, but this is inefficient and
998deprecated; do not use them).</p>
999</div>
1000<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291001<p>The native transport (i.e. <code>git://</code> URL) does no authentication and
Junio C Hamanob96f40a2024-08-01 00:57:251002should be used with caution on unsecured networks.</p>
1003</div>
1004<div class="paragraph">
1005<p>The following syntaxes may be used with them:</p>
1006</div>
1007<div class="ulist">
1008<ul>
1009<li>
1010<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>
1011</li>
1012<li>
Junio C Hamanodc392382024-10-11 18:57:291013<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:251014</li>
1015<li>
1016<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>
1017</li>
1018<li>
1019<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>
1020</li>
1021</ul>
1022</div>
1023<div class="paragraph">
1024<p>An alternative scp-like syntax may also be used with the ssh protocol:</p>
1025</div>
1026<div class="ulist">
1027<ul>
1028<li>
1029<p>[<em>&lt;user&gt;</em><code>@</code>]<em>&lt;host&gt;</em><code>:/</code><em>&lt;path-to-git-repo&gt;</em></p>
1030</li>
1031</ul>
1032</div>
1033<div class="paragraph">
1034<p>This syntax is only recognized if there are no slashes before the
1035first colon. This helps differentiate a local path that contains a
1036colon. For example the local path <code>foo:bar</code> could be specified as an
Junio C Hamanodc392382024-10-11 18:57:291037absolute path or .<code>/foo:bar</code> to avoid being misinterpreted as an ssh
Junio C Hamanob96f40a2024-08-01 00:57:251038url.</p>
1039</div>
1040<div class="paragraph">
1041<p>The ssh and git protocols additionally support <code>~</code><em>&lt;username&gt;</em> expansion:</p>
1042</div>
1043<div class="ulist">
1044<ul>
1045<li>
1046<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>
1047</li>
1048<li>
1049<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>
1050</li>
1051<li>
1052<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>
1053</li>
1054</ul>
1055</div>
1056<div class="paragraph">
1057<p>For local repositories, also supported by Git natively, the following
1058syntaxes may be used:</p>
1059</div>
1060<div class="ulist">
1061<ul>
1062<li>
1063<p><code>/path/to/repo.git/</code></p>
1064</li>
1065<li>
Junio C Hamanodc392382024-10-11 18:57:291066<p><code>file:///path/to/repo.git/</code></p>
Junio C Hamanob96f40a2024-08-01 00:57:251067</li>
1068</ul>
1069</div>
1070<div class="paragraph">
1071<p>These two syntaxes are mostly equivalent, except when cloning, when
1072the former implies <code>--local</code> option. See <a href="git-clone.html">git-clone(1)</a> for
1073details.</p>
1074</div>
1075<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291076<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:251077accept a suitable bundle file. See <a href="git-bundle.html">git-bundle(1)</a>.</p>
1078</div>
1079<div class="paragraph">
1080<p>When Git doesn&#8217;t know how to handle a certain transport protocol, it
1081attempts to use the <code>remote-</code><em>&lt;transport&gt;</em> remote helper, if one
1082exists. To explicitly request a remote helper, the following syntax
1083may be used:</p>
1084</div>
1085<div class="ulist">
1086<ul>
1087<li>
Junio C Hamanodc392382024-10-11 18:57:291088<p><em>&lt;transport&gt;</em><code>::</code><em>&lt;address&gt;</em></p>
Junio C Hamanob96f40a2024-08-01 00:57:251089</li>
1090</ul>
1091</div>
1092<div class="paragraph">
1093<p>where <em>&lt;address&gt;</em> may be a path, a server and path, or an arbitrary
1094URL-like string recognized by the specific remote helper being
1095invoked. See <a href="gitremote-helpers.html">gitremote-helpers(7)</a> for details.</p>
1096</div>
1097<div class="paragraph">
1098<p>If there are a large number of similarly-named remote repositories and
1099you want to use a different format for them (such that the URLs you
1100use will be rewritten into URLs that work), you can create a
1101configuration section of the form:</p>
1102</div>
1103<div class="verseblock">
1104<pre class="content"> [url "<em>&lt;actual-url-base&gt;</em>"]
1105 insteadOf = <em>&lt;other-url-base&gt;</em></pre>
1106</div>
1107<div class="paragraph">
1108<p>For example, with this:</p>
1109</div>
1110<div class="listingblock">
1111<div class="content">
1112<pre> [url "git://git.host.xz/"]
1113 insteadOf = host.xz:/path/to/
1114 insteadOf = work:</pre>
1115</div>
1116</div>
1117<div class="paragraph">
1118<p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
1119rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p>
1120</div>
1121<div class="paragraph">
1122<p>If you want to rewrite URLs for push only, you can create a
1123configuration section of the form:</p>
1124</div>
1125<div class="verseblock">
1126<pre class="content"> [url "<em>&lt;actual-url-base&gt;</em>"]
1127 pushInsteadOf = <em>&lt;other-url-base&gt;</em></pre>
1128</div>
1129<div class="paragraph">
1130<p>For example, with this:</p>
1131</div>
1132<div class="listingblock">
1133<div class="content">
1134<pre> [url "ssh://example.org/"]
1135 pushInsteadOf = git://example.org/</pre>
1136</div>
1137</div>
1138<div class="paragraph">
1139<p>a URL like "git://example.org/path/to/repo.git" will be rewritten to
1140"ssh://example.org/path/to/repo.git" for pushes, but pulls will still
1141use the original URL.</p>
1142</div>
1143</div>
1144</div>
1145<div class="sect1">
1146<h2 id="_remotes">REMOTES<a id="REMOTES"></a></h2>
1147<div class="sectionbody">
1148<div class="paragraph">
1149<p>The name of one of the following can be used instead
Junio C Hamanodc392382024-10-11 18:57:291150of a URL as <em>&lt;repository&gt;</em> argument:</p>
Junio C Hamanob96f40a2024-08-01 00:57:251151</div>
1152<div class="ulist">
1153<ul>
1154<li>
1155<p>a remote in the Git configuration file: <code>$GIT_DIR/config</code>,</p>
1156</li>
1157<li>
1158<p>a file in the <code>$GIT_DIR/remotes</code> directory, or</p>
1159</li>
1160<li>
1161<p>a file in the <code>$GIT_DIR/branches</code> directory.</p>
1162</li>
1163</ul>
1164</div>
1165<div class="paragraph">
1166<p>All of these also allow you to omit the refspec from the command line
1167because they each contain a refspec which git will use by default.</p>
1168</div>
1169<div class="sect2">
1170<h3 id="_named_remote_in_configuration_file">Named remote in configuration file</h3>
1171<div class="paragraph">
1172<p>You can choose to provide the name of a remote which you had previously
1173configured using <a href="git-remote.html">git-remote(1)</a>, <a href="git-config.html">git-config(1)</a>
1174or even by a manual edit to the <code>$GIT_DIR/config</code> file. The URL of
1175this remote will be used to access the repository. The refspec
1176of this remote will be used by default when you do
1177not provide a refspec on the command line. The entry in the
1178config file would appear like this:</p>
1179</div>
1180<div class="listingblock">
1181<div class="content">
1182<pre> [remote "&lt;name&gt;"]
1183 url = &lt;URL&gt;
1184 pushurl = &lt;pushurl&gt;
1185 push = &lt;refspec&gt;
1186 fetch = &lt;refspec&gt;</pre>
1187</div>
1188</div>
1189<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291190<p>The <em>&lt;pushurl&gt;</em> is used for pushes only. It is optional and defaults
1191to <em>&lt;URL&gt;</em>. Pushing to a remote affects all defined pushurls or all
Junio C Hamanob96f40a2024-08-01 00:57:251192defined urls if no pushurls are defined. Fetch, however, will only
1193fetch from the first defined url if multiple urls are defined.</p>
1194</div>
1195</div>
1196<div class="sect2">
1197<h3 id="_named_file_in_git_dirremotes">Named file in <code>$GIT_DIR/remotes</code></h3>
1198<div class="paragraph">
1199<p>You can choose to provide the name of a
1200file in <code>$GIT_DIR/remotes</code>. The URL
1201in this file will be used to access the repository. The refspec
1202in this file will be used as default when you do not
1203provide a refspec on the command line. This file should have the
1204following format:</p>
1205</div>
1206<div class="listingblock">
1207<div class="content">
1208<pre> URL: one of the above URL formats
1209 Push: &lt;refspec&gt;
1210 Pull: &lt;refspec&gt;</pre>
1211</div>
1212</div>
1213<div class="paragraph">
1214<p><code>Push:</code> lines are used by <em>git push</em> and
1215<code>Pull:</code> lines are used by <em>git pull</em> and <em>git fetch</em>.
1216Multiple <code>Push:</code> and <code>Pull:</code> lines may
1217be specified for additional branch mappings.</p>
1218</div>
1219</div>
1220<div class="sect2">
1221<h3 id="_named_file_in_git_dirbranches">Named file in <code>$GIT_DIR/branches</code></h3>
1222<div class="paragraph">
1223<p>You can choose to provide the name of a
1224file in <code>$GIT_DIR/branches</code>.
1225The URL in this file will be used to access the repository.
1226This file should have the following format:</p>
1227</div>
1228<div class="listingblock">
1229<div class="content">
1230<pre> &lt;URL&gt;#&lt;head&gt;</pre>
1231</div>
1232</div>
1233<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291234<p><em>&lt;URL&gt;</em> is required; #<em>&lt;head&gt;</em> is optional.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251235</div>
1236<div class="paragraph">
1237<p>Depending on the operation, git will use one of the following
1238refspecs, if you don&#8217;t provide one on the command line.
Junio C Hamanodc392382024-10-11 18:57:291239<em>&lt;branch&gt;</em> is the name of this file in <code>$GIT_DIR/branches</code> and
1240<em>&lt;head&gt;</em> defaults to <code>master</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251241</div>
1242<div class="paragraph">
1243<p>git fetch uses:</p>
1244</div>
1245<div class="listingblock">
1246<div class="content">
1247<pre> refs/heads/&lt;head&gt;:refs/heads/&lt;branch&gt;</pre>
1248</div>
1249</div>
1250<div class="paragraph">
1251<p>git push uses:</p>
1252</div>
1253<div class="listingblock">
1254<div class="content">
1255<pre> HEAD:refs/heads/&lt;head&gt;</pre>
1256</div>
1257</div>
1258</div>
1259</div>
1260</div>
1261<div class="sect1">
1262<h2 id="_configured_remote_tracking_branches">CONFIGURED REMOTE-TRACKING BRANCHES<a id="CRTB"></a></h2>
1263<div class="sectionbody">
1264<div class="paragraph">
1265<p>You often interact with the same remote repository by
1266regularly and repeatedly fetching from it. In order to keep track
Junio C Hamanodc392382024-10-11 18:57:291267of the progress of such a remote repository, <code>git</code> <code>fetch</code> allows you
1268to configure <code>remote.</code><em>&lt;repository&gt;</em><code>.fetch</code> configuration variables.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251269</div>
1270<div class="paragraph">
1271<p>Typically such a variable may look like this:</p>
1272</div>
1273<div class="listingblock">
1274<div class="content">
1275<pre>[remote "origin"]
1276 fetch = +refs/heads/*:refs/remotes/origin/*</pre>
1277</div>
1278</div>
1279<div class="paragraph">
1280<p>This configuration is used in two ways:</p>
1281</div>
1282<div class="ulist">
1283<ul>
1284<li>
Junio C Hamanodc392382024-10-11 18:57:291285<p>When <code>git</code> <code>fetch</code> is run without specifying what branches
1286and/or tags to fetch on the command line, e.g. <code>git</code> <code>fetch</code> <code>origin</code>
1287or <code>git</code> <code>fetch</code>, <code>remote.</code><em>&lt;repository&gt;</em><code>.fetch</code> values are used as
Junio C Hamanob96f40a2024-08-01 00:57:251288the refspecs&#8212;&#8203;they specify which refs to fetch and which local refs
1289to update. The example above will fetch
1290all branches that exist in the <code>origin</code> (i.e. any ref that matches
Junio C Hamanoe03f5992025-04-23 22:24:291291the left-hand side of the value, <code>refs/heads/*</code>) and update the
1292corresponding remote-tracking branches in the <code>refs/remotes/origin/*</code>
Junio C Hamanob96f40a2024-08-01 00:57:251293hierarchy.</p>
1294</li>
1295<li>
Junio C Hamanodc392382024-10-11 18:57:291296<p>When <code>git</code> <code>fetch</code> is run with explicit branches and/or tags
1297to fetch on the command line, e.g. <code>git</code> <code>fetch</code> <code>origin</code> <code>master</code>, the
Junio C Hamanob96f40a2024-08-01 00:57:251298&lt;refspec&gt;s given on the command line determine what are to be
1299fetched (e.g. <code>master</code> in the example,
1300which is a short-hand for <code>master:</code>, which in turn means
1301"fetch the <em>master</em> branch but I do not explicitly say what
1302remote-tracking branch to update with it from the command line"),
1303and the example command will
Junio C Hamanodc392382024-10-11 18:57:291304fetch <em>only</em> the <em>master</em> branch. The <code>remote.</code><em>&lt;repository&gt;</em><code>.fetch</code>
Junio C Hamanob96f40a2024-08-01 00:57:251305values determine which
1306remote-tracking branch, if any, is updated. When used in this
Junio C Hamanodc392382024-10-11 18:57:291307way, the <code>remote.</code><em>&lt;repository&gt;</em><code>.fetch</code> values do not have any
Junio C Hamanob96f40a2024-08-01 00:57:251308effect in deciding <em>what</em> gets fetched (i.e. the values are not
1309used as refspecs when the command-line lists refspecs); they are
1310only used to decide <em>where</em> the refs that are fetched are stored
1311by acting as a mapping.</p>
1312</li>
1313</ul>
1314</div>
1315<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291316<p>The latter use of the <code>remote.</code><em>&lt;repository&gt;</em><code>.fetch</code> values can be
1317overridden by giving the <code>--refmap=</code><em>&lt;refspec&gt;</em> parameter(s) on the
Junio C Hamanob96f40a2024-08-01 00:57:251318command line.</p>
1319</div>
1320</div>
1321</div>
1322<div class="sect1">
1323<h2 id="_pruning">PRUNING</h2>
1324<div class="sectionbody">
1325<div class="paragraph">
1326<p>Git has a default disposition of keeping data unless it&#8217;s explicitly
1327thrown away; this extends to holding onto local references to branches
1328on remotes that have themselves deleted those branches.</p>
1329</div>
1330<div class="paragraph">
1331<p>If left to accumulate, these stale references might make performance
1332worse on big and busy repos that have a lot of branch churn, and
Junio C Hamanodc392382024-10-11 18:57:291333e.g. make the output of commands like <code>git</code> <code>branch</code> <code>-a</code> <code>--contains</code>
1334<em>&lt;commit&gt;</em> needlessly verbose, as well as impacting anything else
Junio C Hamanob96f40a2024-08-01 00:57:251335that&#8217;ll work with the complete set of known references.</p>
1336</div>
1337<div class="paragraph">
1338<p>These remote-tracking references can be deleted as a one-off with
1339either of:</p>
1340</div>
1341<div class="listingblock">
1342<div class="content">
1343<pre># While fetching
1344$ git fetch --prune &lt;name&gt;
1345
1346# Only prune, don't fetch
1347$ git remote prune &lt;name&gt;</pre>
1348</div>
1349</div>
1350<div class="paragraph">
1351<p>To prune references as part of your normal workflow without needing to
1352remember to run that, set <code>fetch.prune</code> globally, or
Junio C Hamanodc392382024-10-11 18:57:291353<code>remote.</code><em>&lt;name&gt;</em><code>.prune</code> per-remote in the config. See
Junio C Hamanob96f40a2024-08-01 00:57:251354<a href="git-config.html">git-config(1)</a>.</p>
1355</div>
1356<div class="paragraph">
1357<p>Here&#8217;s where things get tricky and more specific. The pruning feature
1358doesn&#8217;t actually care about branches, instead it&#8217;ll prune local &#8592;&#8594;
1359remote-references as a function of the refspec of the remote (see
Junio C Hamanodc392382024-10-11 18:57:291360<em>&lt;refspec&gt;</em> and <a href="#CRTB">CONFIGURED REMOTE-TRACKING BRANCHES</a> above).</p>
Junio C Hamanob96f40a2024-08-01 00:57:251361</div>
1362<div class="paragraph">
1363<p>Therefore if the refspec for the remote includes
Junio C Hamanoe03f5992025-04-23 22:24:291364e.g. <code>refs/tags/*:refs/tags/*</code>, or you manually run e.g. <code>git</code> <code>fetch</code>
Junio C Hamanodc392382024-10-11 18:57:291365<code>--prune</code> <em>&lt;name&gt;</em> "refs/tags/*:refs/tags/*" it won&#8217;t be stale remote
Junio C Hamanob96f40a2024-08-01 00:57:251366tracking branches that are deleted, but any local tag that doesn&#8217;t
1367exist on the remote.</p>
1368</div>
1369<div class="paragraph">
1370<p>This might not be what you expect, i.e. you want to prune remote
Junio C Hamanodc392382024-10-11 18:57:291371<em>&lt;name&gt;</em>, but also explicitly fetch tags from it, so when you fetch
Junio C Hamanob96f40a2024-08-01 00:57:251372from it you delete all your local tags, most of which may not have
Junio C Hamanodc392382024-10-11 18:57:291373come from the <em>&lt;name&gt;</em> remote in the first place.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251374</div>
1375<div class="paragraph">
1376<p>So be careful when using this with a refspec like
Junio C Hamanoe03f5992025-04-23 22:24:291377<code>refs/tags/*:refs/tags/*</code>, or any other refspec which might map
Junio C Hamanob96f40a2024-08-01 00:57:251378references from multiple remotes to the same local namespace.</p>
1379</div>
1380<div class="paragraph">
1381<p>Since keeping up-to-date with both branches and tags on the remote is
1382a common use-case the <code>--prune-tags</code> option can be supplied along with
1383<code>--prune</code> to prune local tags that don&#8217;t exist on the remote, and
1384force-update those tags that differ. Tag pruning can also be enabled
Junio C Hamanodc392382024-10-11 18:57:291385with <code>fetch.pruneTags</code> or <code>remote.</code><em>&lt;name&gt;</em><code>.pruneTags</code> in the config. See
Junio C Hamanob96f40a2024-08-01 00:57:251386<a href="git-config.html">git-config(1)</a>.</p>
1387</div>
1388<div class="paragraph">
1389<p>The <code>--prune-tags</code> option is equivalent to having
Junio C Hamanoe03f5992025-04-23 22:24:291390<code>refs/tags/*:refs/tags/*</code> declared in the refspecs of the remote. This
Junio C Hamanob96f40a2024-08-01 00:57:251391can lead to some seemingly strange interactions:</p>
1392</div>
1393<div class="listingblock">
1394<div class="content">
1395<pre># These both fetch tags
1396$ git fetch --no-tags origin 'refs/tags/*:refs/tags/*'
1397$ git fetch --no-tags --prune-tags origin</pre>
1398</div>
1399</div>
1400<div class="paragraph">
1401<p>The reason it doesn&#8217;t error out when provided without <code>--prune</code> or its
1402config versions is for flexibility of the configured versions, and to
1403maintain a 1=1 mapping between what the command line flags do, and
1404what the configuration versions do.</p>
1405</div>
1406<div class="paragraph">
1407<p>It&#8217;s reasonable to e.g. configure <code>fetch.pruneTags=true</code> in
Junio C Hamanodc392382024-10-11 18:57:291408<code>~/.gitconfig</code> to have tags pruned whenever <code>git</code> <code>fetch</code> <code>--prune</code> is
1409run, without making every invocation of <code>git</code> <code>fetch</code> without <code>--prune</code>
Junio C Hamanob96f40a2024-08-01 00:57:251410an error.</p>
1411</div>
1412<div class="paragraph">
1413<p>Pruning tags with <code>--prune-tags</code> also works when fetching a URL
1414instead of a named remote. These will all prune tags not found on
1415origin:</p>
1416</div>
1417<div class="listingblock">
1418<div class="content">
1419<pre>$ git fetch origin --prune --prune-tags
1420$ git fetch origin --prune 'refs/tags/*:refs/tags/*'
1421$ git fetch &lt;url-of-origin&gt; --prune --prune-tags
1422$ git fetch &lt;url-of-origin&gt; --prune 'refs/tags/*:refs/tags/*'</pre>
1423</div>
1424</div>
1425</div>
1426</div>
1427<div class="sect1">
1428<h2 id="_output">OUTPUT</h2>
1429<div class="sectionbody">
1430<div class="paragraph">
1431<p>The output of "git fetch" depends on the transport method used; this
1432section describes the output when fetching over the Git protocol
1433(either locally or via ssh) and Smart HTTP protocol.</p>
1434</div>
1435<div class="paragraph">
1436<p>The status of the fetch is output in tabular form, with each line
1437representing the status of a single ref. Each line is of the form:</p>
1438</div>
1439<div class="listingblock">
1440<div class="content">
1441<pre> &lt;flag&gt; &lt;summary&gt; &lt;from&gt; -&gt; &lt;to&gt; [&lt;reason&gt;]</pre>
1442</div>
1443</div>
1444<div class="paragraph">
1445<p>When using <code>--porcelain</code>, the output format is intended to be
1446machine-parseable. In contrast to the human-readable output formats it
1447thus prints to standard output instead of standard error. Each line is
1448of the form:</p>
1449</div>
1450<div class="listingblock">
1451<div class="content">
1452<pre>&lt;flag&gt; &lt;old-object-id&gt; &lt;new-object-id&gt; &lt;local-reference&gt;</pre>
1453</div>
1454</div>
1455<div class="paragraph">
1456<p>The status of up-to-date refs is shown only if the --verbose option is
1457used.</p>
1458</div>
1459<div class="paragraph">
1460<p>In compact output mode, specified with configuration variable
Junio C Hamanodc392382024-10-11 18:57:291461fetch.output, if either entire <em>&lt;from&gt;</em> or <em>&lt;to&gt;</em> is found in the
Junio C Hamanoe03f5992025-04-23 22:24:291462other string, it will be substituted with <code>*</code> in the other string. For
1463example, <code>master</code> <code>-</code>&gt; <code>origin/master</code> becomes <code>master</code> <code>-</code>&gt; <code>origin/*</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251464</div>
1465<div class="dlist">
1466<dl>
1467<dt class="hdlist1">flag</dt>
1468<dd>
1469<p>A single character indicating the status of the ref:</p>
1470<div class="dlist">
1471<dl>
1472<dt class="hdlist1">(space)</dt>
1473<dd>
1474<p>for a successfully fetched fast-forward;</p>
1475</dd>
1476<dt class="hdlist1"><code>+</code></dt>
1477<dd>
1478<p>for a successful forced update;</p>
1479</dd>
1480<dt class="hdlist1"><code>-</code></dt>
1481<dd>
1482<p>for a successfully pruned ref;</p>
1483</dd>
1484<dt class="hdlist1"><code>t</code></dt>
1485<dd>
1486<p>for a successful tag update;</p>
1487</dd>
Junio C Hamanoe03f5992025-04-23 22:24:291488<dt class="hdlist1"><code>*</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251489<dd>
1490<p>for a successfully fetched new ref;</p>
1491</dd>
Junio C Hamanodc392382024-10-11 18:57:291492<dt class="hdlist1">!</dt>
Junio C Hamanob96f40a2024-08-01 00:57:251493<dd>
1494<p>for a ref that was rejected or failed to update; and</p>
1495</dd>
1496<dt class="hdlist1"><code>=</code></dt>
1497<dd>
1498<p>for a ref that was up to date and did not need fetching.</p>
1499</dd>
1500</dl>
1501</div>
1502</dd>
1503<dt class="hdlist1">summary</dt>
1504<dd>
1505<p>For a successfully fetched ref, the summary shows the old and new
1506values of the ref in a form suitable for using as an argument to
Junio C Hamanodc392382024-10-11 18:57:291507<code>git</code> <code>log</code> (this is <em>&lt;old&gt;</em><code>..</code><em>&lt;new&gt;</em> in most cases, and
1508<em>&lt;old&gt;</em><code>...</code><em>&lt;new&gt;</em> for forced non-fast-forward updates).</p>
Junio C Hamanob96f40a2024-08-01 00:57:251509</dd>
1510<dt class="hdlist1">from</dt>
1511<dd>
1512<p>The name of the remote ref being fetched from, minus its
Junio C Hamanodc392382024-10-11 18:57:291513<code>refs/</code><em>&lt;type&gt;</em><code>/</code> prefix. In the case of deletion, the name of
Junio C Hamanob96f40a2024-08-01 00:57:251514the remote ref is "(none)".</p>
1515</dd>
1516<dt class="hdlist1">to</dt>
1517<dd>
1518<p>The name of the local ref being updated, minus its
Junio C Hamanodc392382024-10-11 18:57:291519<code>refs/</code><em>&lt;type&gt;</em><code>/</code> prefix.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251520</dd>
1521<dt class="hdlist1">reason</dt>
1522<dd>
1523<p>A human-readable explanation. In the case of successfully fetched
1524refs, no explanation is needed. For a failed ref, the reason for
1525failure is described.</p>
1526</dd>
1527</dl>
1528</div>
1529</div>
1530</div>
1531<div class="sect1">
1532<h2 id="_examples">EXAMPLES</h2>
1533<div class="sectionbody">
1534<div class="ulist">
1535<ul>
1536<li>
1537<p>Update the remote-tracking branches:</p>
1538<div class="listingblock">
1539<div class="content">
1540<pre>$ git fetch origin</pre>
1541</div>
1542</div>
1543<div class="paragraph">
1544<p>The above command copies all branches from the remote <code>refs/heads/</code>
1545namespace and stores them to the local <code>refs/remotes/origin/</code> namespace,
Junio C Hamanodc392382024-10-11 18:57:291546unless the <code>remote.</code><em>&lt;repository&gt;</em><code>.fetch</code> option is used to specify a
Junio C Hamanob96f40a2024-08-01 00:57:251547non-default refspec.</p>
1548</div>
1549</li>
1550<li>
1551<p>Using refspecs explicitly:</p>
1552<div class="listingblock">
1553<div class="content">
1554<pre>$ git fetch origin +seen:seen maint:tmp</pre>
1555</div>
1556</div>
1557<div class="paragraph">
1558<p>This updates (or creates, as necessary) branches <code>seen</code> and <code>tmp</code> in
1559the local repository by fetching from the branches (respectively)
1560<code>seen</code> and <code>maint</code> from the remote repository.</p>
1561</div>
1562<div class="paragraph">
1563<p>The <code>seen</code> branch will be updated even if it does not fast-forward,
1564because it is prefixed with a plus sign; <code>tmp</code> will not be.</p>
1565</div>
1566</li>
1567<li>
1568<p>Peek at a remote&#8217;s branch, without configuring the remote in your local
1569repository:</p>
1570<div class="listingblock">
1571<div class="content">
1572<pre>$ git fetch git://git.kernel.org/pub/scm/git/git.git maint
1573$ git log FETCH_HEAD</pre>
1574</div>
1575</div>
1576<div class="paragraph">
1577<p>The first command fetches the <code>maint</code> branch from the repository at
1578<code>git://git.kernel.org/pub/scm/git/git.git</code> and the second command uses
1579<code>FETCH_HEAD</code> to examine the branch with <a href="git-log.html">git-log(1)</a>. The fetched
1580objects will eventually be removed by git&#8217;s built-in housekeeping (see
1581<a href="git-gc.html">git-gc(1)</a>).</p>
1582</div>
1583</li>
1584</ul>
1585</div>
1586</div>
1587</div>
1588<div class="sect1">
1589<h2 id="_security">SECURITY</h2>
1590<div class="sectionbody">
1591<div class="paragraph">
1592<p>The fetch and push protocols are not designed to prevent one side from
1593stealing data from the other repository that was not intended to be
1594shared. If you have private data that you need to protect from a malicious
1595peer, your best option is to store it in another repository. This applies
1596to both clients and servers. In particular, namespaces on a server are not
1597effective for read access control; you should only grant read access to a
1598namespace to clients that you would trust with read access to the entire
1599repository.</p>
1600</div>
1601<div class="paragraph">
1602<p>The known attack vectors are as follows:</p>
1603</div>
1604<div class="olist arabic">
1605<ol class="arabic">
1606<li>
1607<p>The victim sends "have" lines advertising the IDs of objects it has that
1608are not explicitly intended to be shared but can be used to optimize the
1609transfer if the peer also has them. The attacker chooses an object ID X
1610to steal and sends a ref to X, but isn&#8217;t required to send the content of
1611X because the victim already has it. Now the victim believes that the
1612attacker has X, and it sends the content of X back to the attacker
1613later. (This attack is most straightforward for a client to perform on a
1614server, by creating a ref to X in the namespace the client has access
1615to and then fetching it. The most likely way for a server to perform it
1616on a client is to "merge" X into a public branch and hope that the user
1617does additional work on this branch and pushes it back to the server
1618without noticing the merge.)</p>
1619</li>
1620<li>
1621<p>As in #1, the attacker chooses an object ID X to steal. The victim sends
1622an object Y that the attacker already has, and the attacker falsely
1623claims to have X and not Y, so the victim sends Y as a delta against X.
1624The delta reveals regions of X that are similar to Y to the attacker.</p>
1625</li>
1626</ol>
1627</div>
1628</div>
1629</div>
1630<div class="sect1">
1631<h2 id="_configuration">CONFIGURATION</h2>
1632<div class="sectionbody">
1633<div class="paragraph">
1634<p>Everything below this line in this section is selectively included
1635from the <a href="git-config.html">git-config(1)</a> documentation. The content is the same
1636as what&#8217;s found there:</p>
1637</div>
1638<div class="dlist">
1639<dl>
1640<dt class="hdlist1">fetch.recurseSubmodules</dt>
1641<dd>
Junio C Hamanodc392382024-10-11 18:57:291642<p>This option controls whether <code>git</code> <code>fetch</code> (and the underlying fetch
1643in <code>git</code> <code>pull</code>) will recursively fetch into populated submodules.
Junio C Hamanob96f40a2024-08-01 00:57:251644This option can be set either to a boolean value or to <em>on-demand</em>.
1645Setting it to a boolean changes the behavior of fetch and pull to
1646recurse unconditionally into submodules when set to true or to not
1647recurse at all when set to false. When set to <em>on-demand</em>, fetch and
1648pull will only recurse into a populated submodule when its
1649superproject retrieves a commit that updates the submodule&#8217;s
1650reference.
1651Defaults to <em>on-demand</em>, or to the value of <em>submodule.recurse</em> if set.</p>
1652</dd>
1653<dt class="hdlist1">fetch.fsckObjects</dt>
1654<dd>
1655<p>If it is set to true, git-fetch-pack will check all fetched
1656objects. See <code>transfer.fsckObjects</code> for what&#8217;s
1657checked. Defaults to false. If not set, the value of
1658<code>transfer.fsckObjects</code> is used instead.</p>
1659</dd>
1660<dt class="hdlist1">fetch.fsck.&lt;msg-id&gt;</dt>
1661<dd>
Junio C Hamanodc392382024-10-11 18:57:291662<p>Acts like <code>fsck.</code><em>&lt;msg-id&gt;</em>, but is used by
Junio C Hamanob96f40a2024-08-01 00:57:251663<a href="git-fetch-pack.html">git-fetch-pack(1)</a> instead of <a href="git-fsck.html">git-fsck(1)</a>. See
Junio C Hamanodc392382024-10-11 18:57:291664the <code>fsck.</code><em>&lt;msg-id&gt;</em> documentation for details.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251665</dd>
1666<dt class="hdlist1">fetch.fsck.skipList</dt>
1667<dd>
1668<p>Acts like <code>fsck.skipList</code>, but is used by
1669<a href="git-fetch-pack.html">git-fetch-pack(1)</a> instead of <a href="git-fsck.html">git-fsck(1)</a>. See
1670the <code>fsck.skipList</code> documentation for details.</p>
1671</dd>
1672<dt class="hdlist1">fetch.unpackLimit</dt>
1673<dd>
1674<p>If the number of objects fetched over the Git native
1675transfer is below this
1676limit, then the objects will be unpacked into loose object
1677files. However if the number of received objects equals or
1678exceeds this limit then the received pack will be stored as
1679a pack, after adding any missing delta bases. Storing the
1680pack from a push can make the push operation complete faster,
1681especially on slow filesystems. If not set, the value of
1682<code>transfer.unpackLimit</code> is used instead.</p>
1683</dd>
1684<dt class="hdlist1">fetch.prune</dt>
1685<dd>
1686<p>If true, fetch will automatically behave as if the <code>--prune</code>
Junio C Hamanodc392382024-10-11 18:57:291687option was given on the command line. See also <code>remote.</code><em>&lt;name&gt;</em><code>.prune</code>
Junio C Hamanob96f40a2024-08-01 00:57:251688and the PRUNING section of <a href="git-fetch.html">git-fetch(1)</a>.</p>
1689</dd>
1690<dt class="hdlist1">fetch.pruneTags</dt>
1691<dd>
1692<p>If true, fetch will automatically behave as if the
Junio C Hamanoe03f5992025-04-23 22:24:291693<code>refs/tags/*:refs/tags/*</code> refspec was provided when pruning,
Junio C Hamanob96f40a2024-08-01 00:57:251694if not set already. This allows for setting both this option
1695and <code>fetch.prune</code> to maintain a 1=1 mapping to upstream
Junio C Hamanodc392382024-10-11 18:57:291696refs. See also <code>remote.</code><em>&lt;name&gt;</em><code>.pruneTags</code> and the PRUNING
Junio C Hamanob96f40a2024-08-01 00:57:251697section of <a href="git-fetch.html">git-fetch(1)</a>.</p>
1698</dd>
1699<dt class="hdlist1">fetch.all</dt>
1700<dd>
1701<p>If true, fetch will attempt to update all available remotes.
1702This behavior can be overridden by passing <code>--no-all</code> or by
1703explicitly specifying one or more remote(s) to fetch from.
1704Defaults to false.</p>
1705</dd>
1706<dt class="hdlist1">fetch.output</dt>
1707<dd>
1708<p>Control how ref update status is printed. Valid values are
1709<code>full</code> and <code>compact</code>. Default value is <code>full</code>. See the
1710OUTPUT section in <a href="git-fetch.html">git-fetch(1)</a> for details.</p>
1711</dd>
1712<dt class="hdlist1">fetch.negotiationAlgorithm</dt>
1713<dd>
1714<p>Control how information about the commits in the local repository
1715is sent when negotiating the contents of the packfile to be sent by
1716the server. Set to "consecutive" to use an algorithm that walks
1717over consecutive commits checking each one. Set to "skipping" to
1718use an algorithm that skips commits in an effort to converge
1719faster, but may result in a larger-than-necessary packfile; or set
1720to "noop" to not send any information at all, which will almost
1721certainly result in a larger-than-necessary packfile, but will skip
1722the negotiation step. Set to "default" to override settings made
1723previously and use the default behaviour. The default is normally
1724"consecutive", but if <code>feature.experimental</code> is true, then the
1725default is "skipping". Unknown values will cause <em>git fetch</em> to
1726error out.</p>
1727<div class="paragraph">
1728<p>See also the <code>--negotiate-only</code> and <code>--negotiation-tip</code> options to
1729<a href="git-fetch.html">git-fetch(1)</a>.</p>
1730</div>
1731</dd>
1732<dt class="hdlist1">fetch.showForcedUpdates</dt>
1733<dd>
1734<p>Set to false to enable <code>--no-show-forced-updates</code> in
1735<a href="git-fetch.html">git-fetch(1)</a> and <a href="git-pull.html">git-pull(1)</a> commands.
1736Defaults to true.</p>
1737</dd>
1738<dt class="hdlist1">fetch.parallel</dt>
1739<dd>
1740<p>Specifies the maximal number of fetch operations to be run in parallel
1741at a time (submodules, or remotes when the <code>--multiple</code> option of
1742<a href="git-fetch.html">git-fetch(1)</a> is in effect).</p>
1743<div class="paragraph">
1744<p>A value of 0 will give some reasonable default. If unset, it defaults to 1.</p>
1745</div>
1746<div class="paragraph">
1747<p>For submodules, this setting can be overridden using the <code>submodule.fetchJobs</code>
1748config setting.</p>
1749</div>
1750</dd>
1751<dt class="hdlist1">fetch.writeCommitGraph</dt>
1752<dd>
Junio C Hamanodc392382024-10-11 18:57:291753<p>Set to true to write a commit-graph after every <code>git</code> <code>fetch</code> command
Junio C Hamanob96f40a2024-08-01 00:57:251754that downloads a pack-file from a remote. Using the <code>--split</code> option,
1755most executions will create a very small commit-graph file on top of
1756the existing commit-graph file(s). Occasionally, these files will
1757merge and the write may take longer. Having an updated commit-graph
Junio C Hamanodc392382024-10-11 18:57:291758file helps performance of many Git commands, including <code>git</code> <code>merge-base</code>,
1759<code>git</code> <code>push</code> <code>-f</code>, and <code>git</code> <code>log</code> <code>--graph</code>. Defaults to false.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251760</dd>
1761<dt class="hdlist1">fetch.bundleURI</dt>
1762<dd>
1763<p>This value stores a URI for downloading Git object data from a bundle
1764URI before performing an incremental fetch from the origin Git server.
1765This is similar to how the <code>--bundle-uri</code> option behaves in
Junio C Hamanodc392382024-10-11 18:57:291766<a href="git-clone.html">git-clone(1)</a>. <code>git</code> <code>clone</code> <code>--bundle-uri</code> will set the
Junio C Hamanob96f40a2024-08-01 00:57:251767<code>fetch.bundleURI</code> value if the supplied bundle URI contains a bundle
1768list that is organized for incremental fetches.</p>
1769<div class="paragraph">
1770<p>If you modify this value and your repository has a <code>fetch.bundleCreationToken</code>
1771value, then remove that <code>fetch.bundleCreationToken</code> value before fetching from
1772the new bundle URI.</p>
1773</div>
1774</dd>
1775<dt class="hdlist1">fetch.bundleCreationToken</dt>
1776<dd>
1777<p>When using <code>fetch.bundleURI</code> to fetch incrementally from a bundle
1778list that uses the "creationToken" heuristic, this config value
1779stores the maximum <code>creationToken</code> value of the downloaded bundles.
1780This value is used to prevent downloading bundles in the future
1781if the advertised <code>creationToken</code> is not strictly larger than this
1782value.</p>
1783<div class="paragraph">
1784<p>The creation token values are chosen by the provider serving the specific
1785bundle URI. If you modify the URI at <code>fetch.bundleURI</code>, then be sure to
1786remove the value for the <code>fetch.bundleCreationToken</code> value before fetching.</p>
1787</div>
1788</dd>
1789</dl>
1790</div>
1791</div>
1792</div>
1793<div class="sect1">
1794<h2 id="_bugs">BUGS</h2>
1795<div class="sectionbody">
1796<div class="paragraph">
1797<p>Using --recurse-submodules can only fetch new commits in submodules that are
1798present locally e.g. in <code>$GIT_DIR/modules/</code>. If the upstream adds a new
Junio C Hamanodc392382024-10-11 18:57:291799submodule, that submodule cannot be fetched until it is cloned e.g. by <code>git</code>
1800<code>submodule</code> <code>update</code>. This is expected to be fixed in a future Git version.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251801</div>
1802</div>
1803</div>
1804<div class="sect1">
1805<h2 id="_see_also">SEE ALSO</h2>
1806<div class="sectionbody">
1807<div class="paragraph">
1808<p><a href="git-pull.html">git-pull(1)</a></p>
1809</div>
1810</div>
1811</div>
1812<div class="sect1">
1813<h2 id="_git">GIT</h2>
1814<div class="sectionbody">
1815<div class="paragraph">
1816<p>Part of the <a href="git.html">git(1)</a> suite</p>
1817</div>
1818</div>
1819</div>
1820</div>
1821<div id="footer">
1822<div id="footer-text">
Junio C Hamano1cc68cc2025-08-04 16:37:241823Last updated 2025-06-20 18:10:42 -0700
Junio C Hamanob96f40a2024-08-01 00:57:251824</div>
1825</div>
1826</body>
1827</html>