blob: ee746259fb9b5739fb6eb45b5628aa47ce43d722 [file] [log] [blame]
Junio C Hamanob9d9d902018-05-23 07:07:421<?xml version="1.0" encoding="UTF-8"?>
Junio C Hamano1a4e8412005-12-27 08:17:232<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5<head>
Junio C Hamano9d971152012-12-19 00:43:116<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamanoa85030a2022-07-27 16:48:217<meta name="generator" content="AsciiDoc 10.2.0" />
Junio C Hamano68cf15a2010-11-06 01:01:598<title>git-fetch(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:239<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:1110/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
11
12/* Default font. */
13body {
14 font-family: Georgia,serif;
15}
16
17/* Title font. */
18h1, h2, h3, h4, h5, h6,
19div.title, caption.title,
20thead, p.table.header,
21#toctitle,
22#author, #revnumber, #revdate, #revremark,
23#footer {
24 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2325}
26
27body {
28 margin: 1em 5% 1em 5%;
29}
30
Junio C Hamanoba4b9282008-07-06 05:20:3131a {
32 color: blue;
33 text-decoration: underline;
34}
35a:visited {
36 color: fuchsia;
37}
Junio C Hamano1a4e8412005-12-27 08:17:2338
39em {
40 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5941 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2342}
43
44strong {
45 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5946 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2347}
48
Junio C Hamano1a4e8412005-12-27 08:17:2349h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2351 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
54}
55
Junio C Hamanoba4b9282008-07-06 05:20:3156h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2357 border-bottom: 2px solid silver;
58}
59h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2360 padding-top: 0.5em;
61}
Junio C Hamanoba4b9282008-07-06 05:20:3162h3 {
63 float: left;
64}
65h3 + * {
66 clear: left;
67}
Junio C Hamano9d971152012-12-19 00:43:1168h5 {
69 font-size: 1.0em;
70}
Junio C Hamano1a4e8412005-12-27 08:17:2371
72div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2373 margin-left: 0;
74}
75
76hr {
77 border: 1px solid silver;
78}
79
80p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
83}
84
Junio C Hamano68cf15a2010-11-06 01:01:5985ul, ol, li > p {
86 margin-top: 0;
87}
Junio C Hamano9d971152012-12-19 00:43:1188ul > li { color: #aaa; }
89ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5990
Junio C Hamanoc14e6ad2014-10-31 20:25:5391.monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2395 padding: 0;
96 margin: 0;
97}
Junio C Hamanoc14e6ad2014-10-31 20:25:5398pre {
99 white-space: pre-wrap;
100}
Junio C Hamano1a4e8412005-12-27 08:17:23101
Junio C Hamano9d971152012-12-19 00:43:11102#author {
Junio C Hamano1a4e8412005-12-27 08:17:23103 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23104 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31105 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23106}
Junio C Hamano9d971152012-12-19 00:43:11107#email {
Junio C Hamano1a4e8412005-12-27 08:17:23108}
Junio C Hamano9d971152012-12-19 00:43:11109#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23110}
111
Junio C Hamano9d971152012-12-19 00:43:11112#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
117}
Junio C Hamano9d971152012-12-19 00:43:11118#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23119 float: left;
120 padding-bottom: 0.5em;
121}
Junio C Hamano9d971152012-12-19 00:43:11122#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23123 float: right;
124 padding-bottom: 0.5em;
125}
126
Junio C Hamano9d971152012-12-19 00:43:11127#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
130}
Junio C Hamano9d971152012-12-19 00:43:11131div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23132div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22134 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23135 margin-bottom: 1.5em;
136}
137div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23142}
143
144div.content { /* Block element content. */
145 padding: 0;
146}
147
148/* Block element titles. */
149div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59150 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
155}
156div.title + * {
157 margin-top: 0;
158}
159
160td div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content div.title:first-child {
164 margin-top: 0.0em;
165}
166div.content + div.title {
167 margin-top: 0.0em;
168}
169
170div.sidebarblock > div.content {
171 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23174 padding: 0.5em;
175}
176
177div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23181 padding: 0.5em;
182}
183
Junio C Hamano7bd050f2011-09-22 06:32:22184div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59187 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11188 border-left: 5px solid #f0f0f0;
189 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23190}
Junio C Hamano7bd050f2011-09-22 06:32:22191
Junio C Hamano68cf15a2010-11-06 01:01:59192div.quoteblock > div.attribution {
193 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23194 text-align: right;
195}
Junio C Hamano68cf15a2010-11-06 01:01:59196
Junio C Hamano9d971152012-12-19 00:43:11197div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59200}
201div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
204}
205/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31206div.verseblock + div.attribution {
207 text-align: left;
208}
Junio C Hamano1a4e8412005-12-27 08:17:23209
210div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
217}
218div.admonitionblock td.content {
219 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22220 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23221}
222
223div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23226}
227
Junio C Hamano1a4e8412005-12-27 08:17:23228div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53229span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano68cf15a2010-11-06 01:01:59230a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23231
232dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
235}
236dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59239 font-style: normal;
240 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23241}
242dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59243 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23244}
245
246ul, ol {
247 list-style-position: outside;
248}
Junio C Hamano68cf15a2010-11-06 01:01:59249ol.arabic {
250 list-style-type: decimal;
251}
252ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23253 list-style-type: lower-alpha;
254}
Junio C Hamano68cf15a2010-11-06 01:01:59255ol.upperalpha {
256 list-style-type: upper-alpha;
257}
258ol.lowerroman {
259 list-style-type: lower-roman;
260}
261ol.upperroman {
262 list-style-type: upper-roman;
263}
264
265div.compact ul, div.compact ol,
266div.compact p, div.compact p,
267div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
270}
Junio C Hamano1a4e8412005-12-27 08:17:23271
Junio C Hamano1a4e8412005-12-27 08:17:23272tfoot {
273 font-weight: bold;
274}
Junio C Hamano68cf15a2010-11-06 01:01:59275td > div.verse {
276 white-space: pre;
277}
Junio C Hamano68cf15a2010-11-06 01:01:59278
279div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
282}
Junio C Hamano68cf15a2010-11-06 01:01:59283div.hdlist tr {
284 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31285}
Junio C Hamano68cf15a2010-11-06 01:01:59286dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
288}
289td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23290 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59291 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23292 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59293 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23294}
Junio C Hamano68cf15a2010-11-06 01:01:59295td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23296 vertical-align: top;
297}
Junio C Hamano68cf15a2010-11-06 01:01:59298div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
301}
302
303.comment {
304 background: yellow;
305}
Junio C Hamano1a4e8412005-12-27 08:17:23306
Junio C Hamano7bd050f2011-09-22 06:32:22307.footnote, .footnoteref {
308 font-size: 0.8em;
309}
310
311span.footnote, span.footnoteref {
312 vertical-align: super;
313}
314
315#footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
318}
319
320#footnotes div.footnote {
321 margin: 0 0 5px 0;
322}
323
324#footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
332}
333
Junio C Hamano9d971152012-12-19 00:43:11334div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
338}
339div.colist td img {
340 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23341}
Junio C Hamanoba4b9282008-07-06 05:20:31342
Junio C Hamano9d971152012-12-19 00:43:11343@media print {
344 #footer-badges { display: none; }
345}
346
347#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22348 margin-bottom: 2.5em;
349}
350
Junio C Hamano9d971152012-12-19 00:43:11351#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31352 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
357}
358
Junio C Hamanoc14e6ad2014-10-31 20:25:53359div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31360 margin-top: 0;
361 margin-bottom: 0;
362}
363div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
366}
367div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
370}
371div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
374}
Junio C Hamano9d971152012-12-19 00:43:11375
376span.aqua { color: aqua; }
377span.black { color: black; }
378span.blue { color: blue; }
379span.fuchsia { color: fuchsia; }
380span.gray { color: gray; }
381span.green { color: green; }
382span.lime { color: lime; }
383span.maroon { color: maroon; }
384span.navy { color: navy; }
385span.olive { color: olive; }
386span.purple { color: purple; }
387span.red { color: red; }
388span.silver { color: silver; }
389span.teal { color: teal; }
390span.white { color: white; }
391span.yellow { color: yellow; }
392
393span.aqua-background { background: aqua; }
394span.black-background { background: black; }
395span.blue-background { background: blue; }
396span.fuchsia-background { background: fuchsia; }
397span.gray-background { background: gray; }
398span.green-background { background: green; }
399span.lime-background { background: lime; }
400span.maroon-background { background: maroon; }
401span.navy-background { background: navy; }
402span.olive-background { background: olive; }
403span.purple-background { background: purple; }
404span.red-background { background: red; }
405span.silver-background { background: silver; }
406span.teal-background { background: teal; }
407span.white-background { background: white; }
408span.yellow-background { background: yellow; }
409
410span.big { font-size: 2em; }
411span.small { font-size: 0.6em; }
412
413span.underline { text-decoration: underline; }
414span.overline { text-decoration: overline; }
415span.line-through { text-decoration: line-through; }
416
Junio C Hamanoc14e6ad2014-10-31 20:25:53417div.unbreakable { page-break-inside: avoid; }
418
Junio C Hamano9d971152012-12-19 00:43:11419
420/*
421 * xhtml11 specific
422 *
423 * */
424
425div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
428}
429div.tableblock > table {
430 border: 3px solid #527bbd;
431}
432thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
435}
436p.table {
437 margin-top: 0;
438}
Junio C Hamano725b0da2020-01-22 22:02:40439/* Because the table frame attribute is overridden by CSS in most browsers. */
Junio C Hamano9d971152012-12-19 00:43:11440div.tableblock > table[frame="void"] {
441 border-style: none;
442}
443div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
446}
447div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
450}
451
452
453/*
454 * html5 specific
455 *
456 * */
457
458table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
461}
462thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
465}
466p.tableblock {
467 margin-top: 0;
468}
469table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
475}
476th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
481}
482
483table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
486}
487table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
490}
491table.tableblock.frame-none {
492 border-style: hidden;
493}
494
495th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
497}
498th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
500}
501th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
503}
504
505th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
507}
508th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
510}
511th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
513}
514
515
516/*
517 * manpage specific
518 *
519 * */
520
521body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
526}
Junio C Hamano9d971152012-12-19 00:43:11527body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59528 border-style: none;
529}
Junio C Hamano9d971152012-12-19 00:43:11530body.manpage div.sectionbody {
531 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59532}
533
534@media print {
Junio C Hamano9d971152012-12-19 00:43:11535 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59536}
Junio C Hamanoc14e6ad2014-10-31 20:25:53537
538
Junio C Hamano1a4e8412005-12-27 08:17:23539</style>
Junio C Hamano7bd050f2011-09-22 06:32:22540<script type="text/javascript">
541/*<![CDATA[*/
Junio C Hamano2b153182021-12-15 21:00:31542var asciidoc = { // Namespace.
543
544/////////////////////////////////////////////////////////////////////
545// Table Of Contents generator
546/////////////////////////////////////////////////////////////////////
547
548/* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
550 *
551 * Table Of Content generator
552 * Version: 0.4
553 *
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
556 */
557
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
560
561// toclevels = 1..4.
562toc: function (toclevels) {
563
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
571 }
572 return text;
573 }
574
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
579 }
580
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
593 }
594 iterate(i);
595 }
596 }
597 }
598 iterate(el);
599 return result;
600 }
601
602 var toc = document.getElementById("toc");
603 if (!toc) {
604 return;
605 }
606
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
616 }
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
619 }
620
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
634 }
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
637},
638
639
640/////////////////////////////////////////////////////////////////////
641// Footnotes generator
642/////////////////////////////////////////////////////////////////////
643
644/* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
646 */
647
648footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
651 var noteholder = document.getElementById("footnotes");
652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
659 entriesToRemove.push(entry);
660 }
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
663 }
664
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
682 }
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
689 }
690 }
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
703 }
704 }
705 }
706},
707
708install: function(toclevels) {
709 var timerId;
710
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
715 }
716 }
717
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
721 }
722
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
728}
729
730}
Junio C Hamano9d971152012-12-19 00:43:11731asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22732/*]]>*/
733</script>
Junio C Hamano1a4e8412005-12-27 08:17:23734</head>
Junio C Hamano9d971152012-12-19 00:43:11735<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23736<div id="header">
737<h1>
738git-fetch(1) Manual Page
739</h1>
740<h2>NAME</h2>
741<div class="sectionbody">
742<p>git-fetch -
Junio C Hamano7c73c662007-01-19 00:37:50743 Download objects and refs from another repository
Junio C Hamano1a4e8412005-12-27 08:17:23744</p>
745</div>
746</div>
Junio C Hamano7bd050f2011-09-22 06:32:22747<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11748<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59749<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23750<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59751<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11752<pre class="content"><em>git fetch</em> [&lt;options&gt;] [&lt;repository&gt; [&lt;refspec&gt;&#8230;]]
Junio C Hamano15567bc2011-07-23 00:51:59753<em>git fetch</em> [&lt;options&gt;] &lt;group&gt;
754<em>git fetch</em> --multiple [&lt;options&gt;] [(&lt;repository&gt; | &lt;group&gt;)&#8230;]
Junio C Hamano9d971152012-12-19 00:43:11755<em>git fetch</em> --all [&lt;options&gt;]</pre>
756<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59757</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23758</div>
Junio C Hamano9d971152012-12-19 00:43:11759</div>
760<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31761<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23762<div class="sectionbody">
Junio C Hamano45f804f2014-06-20 22:24:49763<div class="paragraph"><p>Fetch branches and/or tags (collectively, "refs") from one or more
764other repositories, along with the objects necessary to complete their
765histories. Remote-tracking branches are updated (see the description
766of &lt;refspec&gt; below for ways to control this behavior).</p></div>
767<div class="paragraph"><p>By default, any tag that points into the histories being fetched is
768also fetched; the effect is to fetch tags that
Junio C Hamano4c8f2d92013-12-13 00:55:42769point at branches that you are interested in. This default behavior
Junio C Hamano45f804f2014-06-20 22:24:49770can be changed by using the --tags or --no-tags options or by
Junio C Hamano322c6242015-03-23 21:32:46771configuring remote.&lt;name&gt;.tagOpt. By using a refspec that fetches tags
Junio C Hamano45f804f2014-06-20 22:24:49772explicitly, you can fetch tags that do not point into branches you
773are interested in as well.</p></div>
774<div class="paragraph"><p><em>git fetch</em> can fetch from either a single named repository or URL,
Junio C Hamano9df0c662009-11-23 11:09:27775or from several repositories at once if &lt;group&gt; is given and
776there is a remotes.&lt;group&gt; entry in the configuration file.
Junio C Hamanoa28a9202012-06-21 07:08:23777(See <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53778<div class="paragraph"><p>When no remote is specified, by default the <code>origin</code> remote will be used,
Junio C Hamanocf77b042013-12-17 23:54:21779unless there&#8217;s an upstream branch configured for the current branch.</p></div>
Junio C Hamano45f804f2014-06-20 22:24:49780<div class="paragraph"><p>The names of refs that are fetched, together with the object names
Junio C Hamanoc14e6ad2014-10-31 20:25:53781they point at, are written to <code>.git/FETCH_HEAD</code>. This information
Junio C Hamano45f804f2014-06-20 22:24:49782may be used by scripts or other git commands, such as <a href="git-pull.html">git-pull(1)</a>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23783</div>
Junio C Hamano9d971152012-12-19 00:43:11784</div>
785<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31786<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23787<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59788<div class="dlist"><dl>
789<dt class="hdlist1">
Junio C Hamano9df0c662009-11-23 11:09:27790--all
791</dt>
792<dd>
793<p>
794 Fetch all remotes.
795</p>
796</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59797<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47798-a
799</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59800<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47801--append
Junio C Hamano1a4e8412005-12-27 08:17:23802</dt>
803<dd>
804<p>
805 Append ref names and object names of fetched refs to the
Junio C Hamanoc14e6ad2014-10-31 20:25:53806 existing contents of <code>.git/FETCH_HEAD</code>. Without this
807 option old data in <code>.git/FETCH_HEAD</code> will be overwritten.
Junio C Hamano1a4e8412005-12-27 08:17:23808</p>
809</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59810<dt class="hdlist1">
Junio C Hamano7887f9b2021-01-25 23:32:33811--atomic
812</dt>
813<dd>
814<p>
815 Use an atomic transaction to update local refs. Either all refs are
816 updated, or on error, no refs are updated.
817</p>
818</dd>
819<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55820--depth=&lt;depth&gt;
Junio C Hamanoe663a7a2006-01-25 12:37:28821</dt>
Junio C Hamanoe663a7a2006-01-25 12:37:28822<dd>
823<p>
Junio C Hamano4e6ba272016-01-20 23:23:19824 Limit fetching to the specified number of commits from the tip of
825 each remote branch history. If fetching to a <em>shallow</em> repository
826 created by <code>git clone</code> with <code>--depth=&lt;depth&gt;</code> option (see
827 <a href="git-clone.html">git-clone(1)</a>), deepen or shorten the history to the specified
828 number of commits. Tags for the deepened commits are not fetched.
Junio C Hamanoe663a7a2006-01-25 12:37:28829</p>
830</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59831<dt class="hdlist1">
Junio C Hamano20829a42016-10-10 23:24:44832--deepen=&lt;depth&gt;
833</dt>
834<dd>
835<p>
836 Similar to --depth, except it specifies the number of commits
837 from the current shallow boundary instead of from the tip of
838 each remote branch history.
839</p>
840</dd>
841<dt class="hdlist1">
842--shallow-since=&lt;date&gt;
843</dt>
844<dd>
845<p>
846 Deepen or shorten the history of a shallow repository to
847 include all reachable commits after &lt;date&gt;.
848</p>
849</dd>
850<dt class="hdlist1">
851--shallow-exclude=&lt;revision&gt;
852</dt>
853<dd>
854<p>
855 Deepen or shorten the history of a shallow repository to
856 exclude commits reachable from a specified remote branch or tag.
857 This option can be specified multiple times.
858</p>
859</dd>
860<dt class="hdlist1">
Junio C Hamano0d1122e2013-02-01 21:37:02861--unshallow
862</dt>
863<dd>
864<p>
Junio C Hamano61525f92014-01-17 22:46:49865 If the source repository is complete, convert a shallow
866 repository to a complete one, removing all the limitations
867 imposed by shallow repositories.
868</p>
869<div class="paragraph"><p>If the source repository is shallow, fetch as much as possible so that
870the current repository has the same history as the source repository.</p></div>
871</dd>
872<dt class="hdlist1">
873--update-shallow
874</dt>
875<dd>
876<p>
877 By default when fetching from a shallow repository,
Junio C Hamanoc14e6ad2014-10-31 20:25:53878 <code>git fetch</code> refuses refs that require updating
Junio C Hamano61525f92014-01-17 22:46:49879 .git/shallow. This option updates .git/shallow and accept such
880 refs.
Junio C Hamano0d1122e2013-02-01 21:37:02881</p>
882</dd>
883<dt class="hdlist1">
Junio C Hamanof09b7cd2018-08-02 23:01:45884--negotiation-tip=&lt;commit|glob&gt;
885</dt>
886<dd>
887<p>
888 By default, Git will report, to the server, commits reachable
889 from all local refs to find common commits in an attempt to
890 reduce the size of the to-be-received packfile. If specified,
891 Git will only report commits reachable from the given tips.
892 This is useful to speed up fetches when the user knows which
893 local ref is likely to have commits in common with the
894 upstream ref being fetched.
895</p>
896<div class="paragraph"><p>This option may be specified more than once; if so, Git will report
897commits reachable from any of the given commits.</p></div>
898<div class="paragraph"><p>The argument to this option may be a glob on ref names, a ref, or the (possibly
899abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying
900this option multiple times, one for each matching ref name.</p></div>
Junio C Hamano3c27de62021-07-19 21:04:03901<div class="paragraph"><p>See also the <code>fetch.negotiationAlgorithm</code> and <code>push.negotiate</code>
902configuration variables documented in <a href="git-config.html">git-config(1)</a>, and the
903<code>--negotiate-only</code> option below.</p></div>
904</dd>
905<dt class="hdlist1">
906--negotiate-only
907</dt>
908<dd>
909<p>
910 Do not fetch anything from the server, and instead print the
911 ancestors of the provided <code>--negotiation-tip=*</code> arguments,
912 which we have in common with the server.
913</p>
Junio C Hamanof1fc6ca2022-02-17 01:32:33914<div class="paragraph"><p>This is incompatible with <code>--recurse-submodules=[yes|on-demand]</code>.
915Internally this is used to implement the <code>push.negotiate</code> option, see
Junio C Hamano3c27de62021-07-19 21:04:03916<a href="git-config.html">git-config(1)</a>.</p></div>
Junio C Hamanof09b7cd2018-08-02 23:01:45917</dd>
918<dt class="hdlist1">
Junio C Hamano9df0c662009-11-23 11:09:27919--dry-run
920</dt>
921<dd>
922<p>
923 Show what would be done, without making any changes.
924</p>
925</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59926<dt class="hdlist1">
Junio C Hamanod37473e2023-05-15 23:04:43927--porcelain
928</dt>
929<dd>
930<p>
931 Print the output to standard output in an easy-to-parse format for
932 scripts. See section OUTPUT in <a href="git-fetch.html">git-fetch(1)</a> for details.
933</p>
934<div class="paragraph"><p>This is incompatible with <code>--recurse-submodules=[yes|on-demand]</code> and takes
935precedence over the <code>fetch.output</code> config option.</p></div>
936</dd>
937<dt class="hdlist1">
Junio C Hamano48d7a8a2020-08-24 22:56:56938--[no-]write-fetch-head
939</dt>
940<dd>
941<p>
942 Write the list of remote refs fetched in the <code>FETCH_HEAD</code>
943 file directly under <code>$GIT_DIR</code>. This is the default.
944 Passing <code>--no-write-fetch-head</code> from the command line tells
945 Git not to write the file. Under <code>--dry-run</code> option, the
946 file is never written.
947</p>
948</dd>
949<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47950-f
951</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59952<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47953--force
Junio C Hamano1a4e8412005-12-27 08:17:23954</dt>
955<dd>
956<p>
Junio C Hamano980e61e2018-09-17 22:45:52957 When <em>git fetch</em> is used with <code>&lt;src&gt;:&lt;dst&gt;</code> refspec it may
958 refuse to update the local branch as discussed
959 in the <code>&lt;refspec&gt;</code> part below.
960 This option overrides that check.
Junio C Hamano1a4e8412005-12-27 08:17:23961</p>
962</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59963<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55964-k
965</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59966<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:55967--keep
968</dt>
969<dd>
970<p>
971 Keep downloaded pack.
972</p>
973</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59974<dt class="hdlist1">
Junio C Hamano9df0c662009-11-23 11:09:27975--multiple
976</dt>
977<dd>
978<p>
979 Allow several &lt;repository&gt; and &lt;group&gt; arguments to be
980 specified. No &lt;refspec&gt;s may be specified.
981</p>
982</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59983<dt class="hdlist1">
Junio C Hamanoc562f6d2020-09-25 22:50:12984--[no-]auto-maintenance
985</dt>
986<dt class="hdlist1">
Junio C Hamanoc9f11c22019-07-10 02:54:04987--[no-]auto-gc
988</dt>
989<dd>
990<p>
Junio C Hamanoc562f6d2020-09-25 22:50:12991 Run <code>git maintenance run --auto</code> at the end to perform automatic
992 repository maintenance if needed. (<code>--[no-]auto-gc</code> is a synonym.)
993 This is enabled by default.
Junio C Hamanoc9f11c22019-07-10 02:54:04994</p>
995</dd>
996<dt class="hdlist1">
Junio C Hamano8ef91f32019-12-01 22:58:27997--[no-]write-commit-graph
998</dt>
999<dd>
1000<p>
1001 Write a commit-graph after fetching. This overrides the config
1002 setting <code>fetch.writeCommitGraph</code>.
1003</p>
1004</dd>
1005<dt class="hdlist1">
Junio C Hamano4078a552021-04-30 06:08:101006--prefetch
1007</dt>
1008<dd>
1009<p>
1010 Modify the configured refspec to place all refs into the
1011 <code>refs/prefetch/</code> namespace. See the <code>prefetch</code> task in
1012 <a href="git-maintenance.html">git-maintenance(1)</a>.
1013</p>
1014</dd>
1015<dt class="hdlist1">
Junio C Hamano70664a02010-07-13 22:48:051016-p
1017</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591018<dt class="hdlist1">
Junio C Hamano9df0c662009-11-23 11:09:271019--prune
1020</dt>
1021<dd>
1022<p>
Junio C Hamano042f2142016-06-27 18:05:051023 Before fetching, remove any remote-tracking references that no
Junio C Hamano4c8f2d92013-12-13 00:55:421024 longer exist on the remote. Tags are not subject to pruning
1025 if they are fetched only because of the default tag
1026 auto-following or due to a --tags option. However, if tags
1027 are fetched due to an explicit refspec (either on the command
1028 line or in the remote configuration, for example if the remote
1029 was cloned with the --mirror option), then they are also
Junio C Hamano664750f2018-03-06 23:25:441030 subject to pruning. Supplying <code>--prune-tags</code> is a shorthand for
1031 providing the tag refspec.
Junio C Hamano9df0c662009-11-23 11:09:271032</p>
Junio C Hamano664750f2018-03-06 23:25:441033<div class="paragraph"><p>See the PRUNING section below for more details.</p></div>
1034</dd>
1035<dt class="hdlist1">
1036-P
1037</dt>
1038<dt class="hdlist1">
1039--prune-tags
1040</dt>
1041<dd>
1042<p>
1043 Before fetching, remove any local tags that no longer exist on
1044 the remote if <code>--prune</code> is enabled. This option should be used
1045 more carefully, unlike <code>--prune</code> it will remove any local
1046 references (local tags) that have been created. This option is
1047 a shorthand for providing the explicit tag refspec along with
1048 <code>--prune</code>, see the discussion about that in its documentation.
1049</p>
1050<div class="paragraph"><p>See the PRUNING section below for more details.</p></div>
Junio C Hamano9df0c662009-11-23 11:09:271051</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591052<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471053-n
1054</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591055<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471056--no-tags
Junio C Hamano4d04a402006-01-09 00:53:281057</dt>
1058<dd>
1059<p>
Junio C Hamanof7bb6692008-01-27 08:23:461060 By default, tags that point at objects that are downloaded
1061 from the remote repository are fetched and stored locally.
Junio C Hamano075ae872010-09-01 18:43:071062 This option disables this automatic tag following. The default
Junio C Hamano322c6242015-03-23 21:32:461063 behavior for a remote may be specified with the remote.&lt;name&gt;.tagOpt
Junio C Hamanoa28a9202012-06-21 07:08:231064 setting. See <a href="git-config.html">git-config(1)</a>.
Junio C Hamano4d04a402006-01-09 00:53:281065</p>
1066</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591067<dt class="hdlist1">
Junio C Hamano4bea0282022-04-04 18:21:491068--refetch
1069</dt>
1070<dd>
1071<p>
1072 Instead of negotiating with the server to avoid transferring commits and
1073 associated objects that are already present locally, this option fetches
1074 all objects as a fresh clone would. Use this to reapply a partial clone
1075 filter from configuration or using <code>--filter=</code> when the filter
1076 definition has changed. Automatic post-fetch maintenance will perform
1077 object database pack consolidation to remove any duplicate objects.
1078</p>
1079</dd>
1080<dt class="hdlist1">
Junio C Hamano45f804f2014-06-20 22:24:491081--refmap=&lt;refspec&gt;
1082</dt>
1083<dd>
1084<p>
1085 When fetching refs listed on the command line, use the
1086 specified refspec (can be given more than once) to map the
1087 refs to remote-tracking branches, instead of the values of
Junio C Hamanoc14e6ad2014-10-31 20:25:531088 <code>remote.*.fetch</code> configuration variables for the remote
Junio C Hamanobee061d2020-01-30 23:21:181089 repository. Providing an empty <code>&lt;refspec&gt;</code> to the
1090 <code>--refmap</code> option causes Git to ignore the configured
1091 refspecs and rely entirely on the refspecs supplied as
1092 command-line arguments. See section on "Configured Remote-tracking
Junio C Hamano45f804f2014-06-20 22:24:491093 Branches" for details.
1094</p>
1095</dd>
1096<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471097-t
1098</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591099<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471100--tags
Junio C Hamano1a4e8412005-12-27 08:17:231101</dt>
1102<dd>
1103<p>
Junio C Hamano4c8f2d92013-12-13 00:55:421104 Fetch all tags from the remote (i.e., fetch remote tags
Junio C Hamanoc14e6ad2014-10-31 20:25:531105 <code>refs/tags/*</code> into local tags with the same name), in addition
Junio C Hamano4c8f2d92013-12-13 00:55:421106 to whatever else would otherwise be fetched. Using this
1107 option alone does not subject tags to pruning, even if --prune
1108 is used (though tags may be pruned anyway if they are also the
Junio C Hamano92d80372016-07-13 22:00:051109 destination of an explicit refspec; see <code>--prune</code>).
Junio C Hamano1a4e8412005-12-27 08:17:231110</p>
1111</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591112<dt class="hdlist1">
Junio C Hamano5cd15182011-04-05 00:21:101113--recurse-submodules[=yes|on-demand|no]
Junio C Hamano0d75e872010-12-17 06:57:261114</dt>
1115<dd>
1116<p>
Junio C Hamano5cd15182011-04-05 00:21:101117 This option controls if and under what conditions new commits of
Junio C Hamano67fef492022-03-27 17:31:231118 submodules should be fetched too. When recursing through submodules,
1119 <code>git fetch</code> always attempts to fetch "changed" submodules, that is, a
1120 submodule that has commits that are referenced by a newly fetched
1121 superproject commit but are missing in the local submodule clone. A
1122 changed submodule can be fetched as long as it is present locally e.g.
1123 in <code>$GIT_DIR/modules/</code> (see <a href="gitsubmodules.html">gitsubmodules(7)</a>); if the upstream
1124 adds a new submodule, that submodule cannot be fetched until it is
1125 cloned e.g. by <code>git submodule update</code>.
Junio C Hamano5cd15182011-04-05 00:21:101126</p>
Junio C Hamano67fef492022-03-27 17:31:231127<div class="paragraph"><p>When set to <em>on-demand</em>, only changed submodules are fetched. When set
1128to <em>yes</em>, all populated submodules are fetched and submodules that are
1129both unpopulated and changed are fetched. When set to <em>no</em>, submodules
1130are never fetched.</p></div>
1131<div class="paragraph"><p>When unspecified, this uses the value of <code>fetch.recurseSubmodules</code> if it
1132is set (see <a href="git-config.html">git-config(1)</a>), defaulting to <em>on-demand</em> if unset.
1133When this option is used without any value, it defaults to <em>yes</em>.</p></div>
Junio C Hamano5cd15182011-04-05 00:21:101134</dd>
1135<dt class="hdlist1">
Junio C Hamanoa7da1ba2016-01-13 00:19:451136-j
1137</dt>
1138<dt class="hdlist1">
1139--jobs=&lt;n&gt;
1140</dt>
1141<dd>
1142<p>
Junio C Hamanofa2a48b2019-10-15 05:24:401143 Number of parallel children to be used for all forms of fetching.
Junio C Hamanoa7da1ba2016-01-13 00:19:451144</p>
Junio C Hamanofa2a48b2019-10-15 05:24:401145<div class="paragraph"><p>If the <code>--multiple</code> option was specified, the different remotes will be fetched
1146in parallel. If multiple submodules are fetched, they will be fetched in
1147parallel. To control them independently, use the config settings
1148<code>fetch.parallel</code> and <code>submodule.fetchJobs</code> (see <a href="git-config.html">git-config(1)</a>).</p></div>
1149<div class="paragraph"><p>Typically, parallel recursive and multi-remote fetches will be faster. By
1150default fetches are performed sequentially, not in parallel.</p></div>
Junio C Hamanoa7da1ba2016-01-13 00:19:451151</dd>
1152<dt class="hdlist1">
Junio C Hamano5cd15182011-04-05 00:21:101153--no-recurse-submodules
1154</dt>
1155<dd>
1156<p>
1157 Disable recursive fetching of submodules (this has the same effect as
Junio C Hamano92d80372016-07-13 22:00:051158 using the <code>--recurse-submodules=no</code> option).
Junio C Hamano0d75e872010-12-17 06:57:261159</p>
1160</dd>
1161<dt class="hdlist1">
Junio C Hamanocb705392019-09-18 19:30:011162--set-upstream
1163</dt>
1164<dd>
1165<p>
Junio C Hamano779537c2020-08-19 23:48:511166 If the remote is fetched successfully, add upstream
Junio C Hamanocb705392019-09-18 19:30:011167 (tracking) reference, used by argument-less
1168 <a href="git-pull.html">git-pull(1)</a> and other commands. For more information,
1169 see <code>branch.&lt;name&gt;.merge</code> and <code>branch.&lt;name&gt;.remote</code> in
1170 <a href="git-config.html">git-config(1)</a>.
1171</p>
1172</dd>
1173<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:261174--submodule-prefix=&lt;path&gt;
1175</dt>
1176<dd>
1177<p>
1178 Prepend &lt;path&gt; to paths printed in informative messages
1179 such as "Fetching submodule foo". This option is used
1180 internally when recursing over submodules.
1181</p>
1182</dd>
1183<dt class="hdlist1">
Junio C Hamano5cd15182011-04-05 00:21:101184--recurse-submodules-default=[yes|on-demand]
1185</dt>
1186<dd>
1187<p>
1188 This option is used internally to temporarily provide a
1189 non-negative default value for the --recurse-submodules
1190 option. All other methods of configuring fetch&#8217;s submodule
Junio C Hamanoa28a9202012-06-21 07:08:231191 recursion (such as settings in <a href="gitmodules.html">gitmodules(5)</a> and
1192 <a href="git-config.html">git-config(1)</a>) override this option, as does
Junio C Hamano5cd15182011-04-05 00:21:101193 specifying --[no-]recurse-submodules directly.
1194</p>
1195</dd>
1196<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471197-u
1198</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591199<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471200--update-head-ok
Junio C Hamano1a4e8412005-12-27 08:17:231201</dt>
1202<dd>
1203<p>
Junio C Hamano1aa40d22010-01-21 17:46:431204 By default <em>git fetch</em> refuses to update the head which
Junio C Hamano1a4e8412005-12-27 08:17:231205 corresponds to the current branch. This flag disables the
Junio C Hamano1aa40d22010-01-21 17:46:431206 check. This is purely for the internal use for <em>git pull</em>
1207 to communicate with <em>git fetch</em>, and unless you are
Junio C Hamanob288d9e2007-01-02 00:04:151208 implementing your own Porcelain you are not supposed to
1209 use it.
1210</p>
1211</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591212<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551213--upload-pack &lt;upload-pack&gt;
Junio C Hamanob288d9e2007-01-02 00:04:151214</dt>
1215<dd>
1216<p>
Junio C Hamanoc21ab052009-10-31 04:03:551217 When given, and the repository to fetch from is handled
Junio C Hamano92d80372016-07-13 22:00:051218 by <em>git fetch-pack</em>, <code>--exec=&lt;upload-pack&gt;</code> is passed to
Junio C Hamanoc21ab052009-10-31 04:03:551219 the command to specify non-default path for the command
1220 run on the other end.
1221</p>
1222</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591223<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551224-q
1225</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591226<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551227--quiet
1228</dt>
1229<dd>
1230<p>
1231 Pass --quiet to git-fetch-pack and silence any other internally
Junio C Hamanoea90ab32010-03-15 20:32:551232 used git commands. Progress is not reported to the standard error
1233 stream.
Junio C Hamanoc21ab052009-10-31 04:03:551234</p>
1235</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591236<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551237-v
1238</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591239<dt class="hdlist1">
Junio C Hamanoc21ab052009-10-31 04:03:551240--verbose
1241</dt>
1242<dd>
1243<p>
1244 Be verbose.
Junio C Hamano1a4e8412005-12-27 08:17:231245</p>
1246</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591247<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:551248--progress
1249</dt>
1250<dd>
1251<p>
1252 Progress status is reported on the standard error stream
1253 by default when it is attached to a terminal, unless -q
1254 is specified. This flag forces progress status even if the
1255 standard error stream is not directed to a terminal.
1256</p>
1257</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591258<dt class="hdlist1">
Junio C Hamanob9d9d902018-05-23 07:07:421259-o &lt;option&gt;
1260</dt>
1261<dt class="hdlist1">
1262--server-option=&lt;option&gt;
1263</dt>
1264<dd>
1265<p>
1266 Transmit the given string to the server when communicating using
1267 protocol version 2. The given string must not contain a NUL or LF
Junio C Hamanod1063b12019-05-08 17:18:071268 character. The server&#8217;s handling of server options, including
1269 unknown ones, is server-specific.
Junio C Hamanob9d9d902018-05-23 07:07:421270 When multiple <code>--server-option=&lt;option&gt;</code> are given, they are all
1271 sent to the other side in the order listed on the command line.
1272</p>
1273</dd>
1274<dt class="hdlist1">
Junio C Hamanoc9f11c22019-07-10 02:54:041275--show-forced-updates
1276</dt>
1277<dd>
1278<p>
1279 By default, git checks if a branch is force-updated during
1280 fetch. This can be disabled through fetch.showForcedUpdates, but
1281 the --show-forced-updates option guarantees this check occurs.
1282 See <a href="git-config.html">git-config(1)</a>.
1283</p>
1284</dd>
1285<dt class="hdlist1">
1286--no-show-forced-updates
1287</dt>
1288<dd>
1289<p>
1290 By default, git checks if a branch is force-updated during
1291 fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates
1292 to false to skip this check for performance reasons. If used during
1293 <em>git-pull</em> the --ff-only option will still check for forced updates
1294 before attempting a fast-forward update. See <a href="git-config.html">git-config(1)</a>.
1295</p>
1296</dd>
1297<dt class="hdlist1">
Junio C Hamano3fcdd072016-02-24 23:41:081298-4
1299</dt>
1300<dt class="hdlist1">
1301--ipv4
1302</dt>
1303<dd>
1304<p>
1305 Use IPv4 addresses only, ignoring IPv6 addresses.
1306</p>
1307</dd>
1308<dt class="hdlist1">
1309-6
1310</dt>
1311<dt class="hdlist1">
1312--ipv6
1313</dt>
1314<dd>
1315<p>
1316 Use IPv6 addresses only, ignoring IPv4 addresses.
1317</p>
1318</dd>
1319<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231320&lt;repository&gt;
1321</dt>
1322<dd>
1323<p>
1324 The "remote" repository that is the source of a fetch
Junio C Hamano054ea082008-06-01 08:26:341325 or pull operation. This parameter can be either a URL
1326 (see the section <a href="#URLS">GIT URLS</a> below) or the name
1327 of a remote (see the section <a href="#REMOTES">REMOTES</a> below).
Junio C Hamano1a4e8412005-12-27 08:17:231328</p>
Junio C Hamano40f2f8d2006-02-07 08:04:391329</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591330<dt class="hdlist1">
Junio C Hamano9df0c662009-11-23 11:09:271331&lt;group&gt;
1332</dt>
1333<dd>
1334<p>
1335 A name referring to a list of repositories as the value
1336 of remotes.&lt;group&gt; in the configuration file.
Junio C Hamanoa28a9202012-06-21 07:08:231337 (See <a href="git-config.html">git-config(1)</a>).
Junio C Hamano9df0c662009-11-23 11:09:271338</p>
1339</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591340<dt class="hdlist1">
Junio C Hamano40f2f8d2006-02-07 08:04:391341&lt;refspec&gt;
1342</dt>
1343<dd>
1344<p>
Junio C Hamano45f804f2014-06-20 22:24:491345 Specifies which refs to fetch and which local refs to update.
1346 When no &lt;refspec&gt;s appear on the command line, the refs to fetch
Junio C Hamanoc14e6ad2014-10-31 20:25:531347 are read from <code>remote.&lt;repository&gt;.fetch</code> variables instead
Junio C Hamano45f804f2014-06-20 22:24:491348 (see <a href="#CRTB">CONFIGURED REMOTE-TRACKING BRANCHES</a> below).
Junio C Hamano40f2f8d2006-02-07 08:04:391349</p>
Junio C Hamano45f804f2014-06-20 22:24:491350<div class="paragraph"><p>The format of a &lt;refspec&gt; parameter is an optional plus
Junio C Hamanof7e3f472017-10-20 06:45:241351<code>+</code>, followed by the source &lt;src&gt;, followed
Junio C Hamanoc14e6ad2014-10-31 20:25:531352by a colon <code>:</code>, followed by the destination ref &lt;dst&gt;.
Junio C Hamanof7e3f472017-10-20 06:45:241353The colon can be omitted when &lt;dst&gt; is empty. &lt;src&gt; is
1354typically a ref, but it can also be a fully spelled hex object
1355name.</p></div>
Junio C Hamanod1281512020-10-05 22:21:551356<div class="paragraph"><p>A &lt;refspec&gt; may contain a <code>*</code> in its &lt;src&gt; to indicate a simple pattern
1357match. Such a refspec functions like a glob that matches any ref with the
1358same prefix. A pattern &lt;refspec&gt; must have a <code>*</code> in both the &lt;src&gt; and
1359&lt;dst&gt;. It will map refs to the destination by replacing the <code>*</code> with the
1360contents matched from the source.</p></div>
1361<div class="paragraph"><p>If a refspec is prefixed by <code>^</code>, it will be interpreted as a negative
1362refspec. Rather than specifying which refs to fetch or which local refs to
1363update, such a refspec will instead specify refs to exclude. A ref will be
1364considered to match if it matches at least one positive refspec, and does
1365not match any negative refspec. Negative refspecs can be useful to restrict
1366the scope of a pattern refspec so that it will not include specific refs.
1367Negative refspecs can themselves be pattern refspecs. However, they may only
1368contain a &lt;src&gt; and do not specify a &lt;dst&gt;. Fully spelled out hex object
1369names are also not supported.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531370<div class="paragraph"><p><code>tag &lt;tag&gt;</code> means the same as <code>refs/tags/&lt;tag&gt;:refs/tags/&lt;tag&gt;</code>;
Junio C Hamano45f804f2014-06-20 22:24:491371it requests fetching everything up to the given tag.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591372<div class="paragraph"><p>The remote ref that matches &lt;src&gt;
Junio C Hamano980e61e2018-09-17 22:45:521373is fetched, and if &lt;dst&gt; is not an empty string, an attempt
1374is made to update the local ref that matches it.</p></div>
1375<div class="paragraph"><p>Whether that update is allowed without <code>--force</code> depends on the ref
1376namespace it&#8217;s being fetched to, the type of object being fetched, and
1377whether the update is considered to be a fast-forward. Generally, the
1378same rules apply for fetching as when pushing, see the <code>&lt;refspec&gt;...</code>
1379section of <a href="git-push.html">git-push(1)</a> for what those are. Exceptions to those
1380rules particular to <em>git fetch</em> are noted below.</p></div>
1381<div class="paragraph"><p>Until Git version 2.20, and unlike when pushing with
1382<a href="git-push.html">git-push(1)</a>, any updates to <code>refs/tags/*</code> would be accepted
Junio C Hamanoca9da322018-09-20 21:53:411383without <code>+</code> in the refspec (or <code>--force</code>). When fetching, we promiscuously
Junio C Hamano980e61e2018-09-17 22:45:521384considered all tag updates from a remote to be forced fetches. Since
Junio C Hamanoca9da322018-09-20 21:53:411385Git version 2.20, fetching to update <code>refs/tags/*</code> works the same way
Junio C Hamano980e61e2018-09-17 22:45:521386as when pushing. I.e. any updates will be rejected without <code>+</code> in the
1387refspec (or <code>--force</code>).</p></div>
1388<div class="paragraph"><p>Unlike when pushing with <a href="git-push.html">git-push(1)</a>, any updates outside of
1389<code>refs/{tags,heads}/*</code> will be accepted without <code>+</code> in the refspec (or
1390<code>--force</code>), whether that&#8217;s swapping e.g. a tree object for a blob, or
1391a commit for another commit that&#8217;s doesn&#8217;t have the previous commit as
1392an ancestor etc.</p></div>
1393<div class="paragraph"><p>Unlike when pushing with <a href="git-push.html">git-push(1)</a>, there is no
1394configuration which&#8217;ll amend these rules, and nothing like a
1395<code>pre-fetch</code> hook analogous to the <code>pre-receive</code> hook.</p></div>
1396<div class="paragraph"><p>As with pushing with <a href="git-push.html">git-push(1)</a>, all of the rules described
1397above about what&#8217;s not allowed as an update can be overridden by
1398adding an the optional leading <code>+</code> to a refspec (or using <code>--force</code>
1399command line option). The only exception to this is that no amount of
1400forcing will make the <code>refs/heads/*</code> namespace accept a non-commit
1401object.</p></div>
Junio C Hamano40f2f8d2006-02-07 08:04:391402<div class="admonitionblock">
1403<table><tr>
1404<td class="icon">
1405<div class="title">Note</div>
1406</td>
Junio C Hamano45f804f2014-06-20 22:24:491407<td class="content">When the remote branch you want to fetch is known to
1408be rewound and rebased regularly, it is expected that
1409its new tip will not be descendant of its previous tip
1410(as stored in your remote-tracking branch the last time
1411you fetched). You would want
Junio C Hamanoc14e6ad2014-10-31 20:25:531412to use the <code>+</code> sign to indicate non-fast-forward updates
Junio C Hamano45f804f2014-06-20 22:24:491413will be needed for such branches. There is no way to
1414determine or declare that a branch will be made available
1415in a repository with this behavior; the pulling user simply
Junio C Hamano40f2f8d2006-02-07 08:04:391416must know this is the expected usage pattern for a branch.</td>
1417</tr></table>
1418</div>
Junio C Hamano40f2f8d2006-02-07 08:04:391419</dd>
Junio C Hamano558abd22020-09-03 20:22:341420<dt class="hdlist1">
1421--stdin
1422</dt>
1423<dd>
1424<p>
1425 Read refspecs, one per line, from stdin in addition to those provided
1426 as arguments. The "tag &lt;name&gt;" format is not supported.
1427</p>
1428</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311429</dl></div>
Junio C Hamano40f2f8d2006-02-07 08:04:391430</div>
Junio C Hamano9d971152012-12-19 00:43:111431</div>
1432<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311433<h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2>
Junio C Hamano40f2f8d2006-02-07 08:04:391434<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591435<div class="paragraph"><p>In general, URLs contain information about the transport protocol, the
Junio C Hamano0c053e82010-04-19 06:46:341436address of the remote server, and the path to the repository.
1437Depending on the transport protocol, some of this information may be
1438absent.</p></div>
Junio C Hamano6631a092012-10-10 22:50:571439<div class="paragraph"><p>Git supports ssh, git, http, and https protocols (in addition, ftp,
Junio C Hamanof85ef632016-02-17 22:31:061440and ftps can be used for fetching, but this is inefficient and
1441deprecated; do not use it).</p></div>
Junio C Hamanoa1952302013-07-01 21:31:181442<div class="paragraph"><p>The native transport (i.e. git:// URL) does no authentication and
1443should be used with caution on unsecured networks.</p></div>
Junio C Hamano6631a092012-10-10 22:50:571444<div class="paragraph"><p>The following syntaxes may be used with them:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591445<div class="ulist"><ul>
Junio C Hamano1a4e8412005-12-27 08:17:231446<li>
1447<p>
Junio C Hamano0c053e82010-04-19 06:46:341448ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:231449</p>
1450</li>
1451<li>
1452<p>
Junio C Hamanoa3bb6eb2009-02-05 01:26:331453git://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:231454</p>
1455</li>
1456<li>
1457<p>
Junio C Hamano0c053e82010-04-19 06:46:341458http&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:231459</p>
1460</li>
1461<li>
1462<p>
Junio C Hamano0c053e82010-04-19 06:46:341463ftp&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamanodbb64592007-09-01 11:17:391464</p>
1465</li>
Junio C Hamanoba4b9282008-07-06 05:20:311466</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591467<div class="paragraph"><p>An alternative scp-like syntax may also be used with the ssh protocol:</p></div>
1468<div class="ulist"><ul>
Junio C Hamano1a4e8412005-12-27 08:17:231469<li>
1470<p>
Junio C Hamano0c053e82010-04-19 06:46:341471&#91;user@&#93;host.xz:path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:231472</p>
1473</li>
Junio C Hamanoba4b9282008-07-06 05:20:311474</ul></div>
Junio C Hamano7e590a12013-06-02 23:46:521475<div class="paragraph"><p>This syntax is only recognized if there are no slashes before the
1476first colon. This helps differentiate a local path that contains a
Junio C Hamanoc14e6ad2014-10-31 20:25:531477colon. For example the local path <code>foo:bar</code> could be specified as an
1478absolute path or <code>./foo:bar</code> to avoid being misinterpreted as an ssh
Junio C Hamano7e590a12013-06-02 23:46:521479url.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591480<div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
1481<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:341482<li>
1483<p>
1484ssh://&#91;user@&#93;host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1485</p>
1486</li>
1487<li>
1488<p>
1489git://host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1490</p>
1491</li>
1492<li>
1493<p>
1494&#91;user@&#93;host.xz:/~&#91;user&#93;/path/to/repo.git/
1495</p>
1496</li>
1497</ul></div>
Junio C Hamano076ffcc2013-02-06 05:13:211498<div class="paragraph"><p>For local repositories, also supported by Git natively, the following
Junio C Hamano0c053e82010-04-19 06:46:341499syntaxes may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591500<div class="ulist"><ul>
Junio C Hamano1a4e8412005-12-27 08:17:231501<li>
1502<p>
1503/path/to/repo.git/
1504</p>
1505</li>
Junio C Hamanob1d6e882007-08-11 08:30:161506<li>
1507<p>
Junio C Hamanodc8f8de2013-06-05 22:58:071508file:///path/to/repo.git/
Junio C Hamanob1d6e882007-08-11 08:30:161509</p>
1510</li>
Junio C Hamanoba4b9282008-07-06 05:20:311511</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591512<div class="paragraph"><p>These two syntaxes are mostly equivalent, except when cloning, when
Junio C Hamanoa28a9202012-06-21 07:08:231513the former implies --local option. See <a href="git-clone.html">git-clone(1)</a> for
Junio C Hamano0c053e82010-04-19 06:46:341514details.</p></div>
Junio C Hamanob4896852019-12-10 23:15:091515<div class="paragraph"><p><em>git clone</em>, <em>git fetch</em> and <em>git pull</em>, but not <em>git push</em>, will also
1516accept a suitable bundle file. See <a href="git-bundle.html">git-bundle(1)</a>.</p></div>
Junio C Hamano076ffcc2013-02-06 05:13:211517<div class="paragraph"><p>When Git doesn&#8217;t know how to handle a certain transport protocol, it
Junio C Hamano0c053e82010-04-19 06:46:341518attempts to use the <em>remote-&lt;transport&gt;</em> remote helper, if one
1519exists. To explicitly request a remote helper, the following syntax
1520may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591521<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:341522<li>
1523<p>
1524&lt;transport&gt;::&lt;address&gt;
1525</p>
1526</li>
1527</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591528<div class="paragraph"><p>where &lt;address&gt; may be a path, a server and path, or an arbitrary
Junio C Hamano0c053e82010-04-19 06:46:341529URL-like string recognized by the specific remote helper being
Junio C Hamanob5513772019-04-22 03:38:391530invoked. See <a href="gitremote-helpers.html">gitremote-helpers(7)</a> for details.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591531<div class="paragraph"><p>If there are a large number of similarly-named remote repositories and
Junio C Hamano24bc09a2008-02-28 00:27:441532you want to use a different format for them (such that the URLs you
1533use will be rewritten into URLs that work), you can create a
Junio C Hamanoba4b9282008-07-06 05:20:311534configuration section of the form:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441535<div class="listingblock">
1536<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531537<pre><code> [url "&lt;actual url base&gt;"]
1538 insteadOf = &lt;other url base&gt;</code></pre>
Junio C Hamano24bc09a2008-02-28 00:27:441539</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591540<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441541<div class="listingblock">
1542<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531543<pre><code> [url "git://git.host.xz/"]
Junio C Hamano24bc09a2008-02-28 00:27:441544 insteadOf = host.xz:/path/to/
Junio C Hamanoc14e6ad2014-10-31 20:25:531545 insteadOf = work:</code></pre>
Junio C Hamano24bc09a2008-02-28 00:27:441546</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591547<div class="paragraph"><p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
Junio C Hamanoba4b9282008-07-06 05:20:311548rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591549<div class="paragraph"><p>If you want to rewrite URLs for push only, you can create a
Junio C Hamano7df6dcf2009-09-13 09:51:171550configuration section of the form:</p></div>
1551<div class="listingblock">
1552<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531553<pre><code> [url "&lt;actual url base&gt;"]
1554 pushInsteadOf = &lt;other url base&gt;</code></pre>
Junio C Hamano7df6dcf2009-09-13 09:51:171555</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591556<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano7df6dcf2009-09-13 09:51:171557<div class="listingblock">
1558<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531559<pre><code> [url "ssh://example.org/"]
1560 pushInsteadOf = git://example.org/</code></pre>
Junio C Hamano7df6dcf2009-09-13 09:51:171561</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591562<div class="paragraph"><p>a URL like "git://example.org/path/to/repo.git" will be rewritten to
Junio C Hamano7df6dcf2009-09-13 09:51:171563"ssh://example.org/path/to/repo.git" for pushes, but pulls will still
1564use the original URL.</p></div>
Junio C Hamano40f2f8d2006-02-07 08:04:391565</div>
Junio C Hamano9d971152012-12-19 00:43:111566</div>
1567<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311568<h2 id="_remotes_a_id_remotes_a">REMOTES<a id="REMOTES"></a></h2>
Junio C Hamano40f2f8d2006-02-07 08:04:391569<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591570<div class="paragraph"><p>The name of one of the following can be used instead
Junio C Hamanoc14e6ad2014-10-31 20:25:531571of a URL as <code>&lt;repository&gt;</code> argument:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591572<div class="ulist"><ul>
Junio C Hamano054ea082008-06-01 08:26:341573<li>
1574<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531575a remote in the Git configuration file: <code>$GIT_DIR/config</code>,
Junio C Hamano054ea082008-06-01 08:26:341576</p>
1577</li>
1578<li>
1579<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531580a file in the <code>$GIT_DIR/remotes</code> directory, or
Junio C Hamano054ea082008-06-01 08:26:341581</p>
1582</li>
1583<li>
1584<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531585a file in the <code>$GIT_DIR/branches</code> directory.
Junio C Hamano054ea082008-06-01 08:26:341586</p>
1587</li>
Junio C Hamanoba4b9282008-07-06 05:20:311588</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591589<div class="paragraph"><p>All of these also allow you to omit the refspec from the command line
Junio C Hamanoba4b9282008-07-06 05:20:311590because they each contain a refspec which git will use by default.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111591<div class="sect2">
1592<h3 id="_named_remote_in_configuration_file">Named remote in configuration file</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591593<div class="paragraph"><p>You can choose to provide the name of a remote which you had previously
Junio C Hamanoa28a9202012-06-21 07:08:231594configured using <a href="git-remote.html">git-remote(1)</a>, <a href="git-config.html">git-config(1)</a>
Junio C Hamanoc14e6ad2014-10-31 20:25:531595or even by a manual edit to the <code>$GIT_DIR/config</code> file. The URL of
Junio C Hamano054ea082008-06-01 08:26:341596this remote will be used to access the repository. The refspec
1597of this remote will be used by default when you do
1598not provide a refspec on the command line. The entry in the
Junio C Hamanoba4b9282008-07-06 05:20:311599config file would appear like this:</p></div>
Junio C Hamano054ea082008-06-01 08:26:341600<div class="listingblock">
1601<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531602<pre><code> [remote "&lt;name&gt;"]
Junio C Hamano59a32b02021-12-10 22:53:381603 url = &lt;URL&gt;
Junio C Hamano0e88f3e2009-06-21 08:03:251604 pushurl = &lt;pushurl&gt;
Junio C Hamano054ea082008-06-01 08:26:341605 push = &lt;refspec&gt;
Junio C Hamanoc14e6ad2014-10-31 20:25:531606 fetch = &lt;refspec&gt;</code></pre>
Junio C Hamano054ea082008-06-01 08:26:341607</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531608<div class="paragraph"><p>The <code>&lt;pushurl&gt;</code> is used for pushes only. It is optional and defaults
Junio C Hamano3583c5c2023-02-22 23:31:591609to <code>&lt;URL&gt;</code>. Pushing to a remote affects all defined pushurls or to all
1610defined urls if no pushurls are defined. Fetch, however, will only
1611fetch from the first defined url if muliple urls are defined.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111612</div>
1613<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531614<h3 id="_named_file_in_code_git_dir_remotes_code">Named file in <code>$GIT_DIR/remotes</code></h3>
Junio C Hamano68cf15a2010-11-06 01:01:591615<div class="paragraph"><p>You can choose to provide the name of a
Junio C Hamanoc14e6ad2014-10-31 20:25:531616file in <code>$GIT_DIR/remotes</code>. The URL
Junio C Hamano054ea082008-06-01 08:26:341617in this file will be used to access the repository. The refspec
1618in this file will be used as default when you do not
1619provide a refspec on the command line. This file should have the
Junio C Hamanoba4b9282008-07-06 05:20:311620following format:</p></div>
Junio C Hamano1caaf472006-12-31 08:29:351621<div class="listingblock">
Junio C Hamano1a4e8412005-12-27 08:17:231622<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531623<pre><code> URL: one of the above URL format
Junio C Hamanod3361ad2007-01-01 03:20:241624 Push: &lt;refspec&gt;
Junio C Hamanoc14e6ad2014-10-31 20:25:531625 Pull: &lt;refspec&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231626</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531627<div class="paragraph"><p><code>Push:</code> lines are used by <em>git push</em> and
1628<code>Pull:</code> lines are used by <em>git pull</em> and <em>git fetch</em>.
1629Multiple <code>Push:</code> and <code>Pull:</code> lines may
Junio C Hamanoba4b9282008-07-06 05:20:311630be specified for additional branch mappings.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111631</div>
1632<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531633<h3 id="_named_file_in_code_git_dir_branches_code">Named file in <code>$GIT_DIR/branches</code></h3>
Junio C Hamano68cf15a2010-11-06 01:01:591634<div class="paragraph"><p>You can choose to provide the name of a
Junio C Hamanoc14e6ad2014-10-31 20:25:531635file in <code>$GIT_DIR/branches</code>.
Junio C Hamano054ea082008-06-01 08:26:341636The URL in this file will be used to access the repository.
Junio C Hamanoba4b9282008-07-06 05:20:311637This file should have the following format:</p></div>
Junio C Hamano1caaf472006-12-31 08:29:351638<div class="listingblock">
Junio C Hamano249572f2006-10-24 05:44:081639<div class="content">
Junio C Hamano59a32b02021-12-10 22:53:381640<pre><code> &lt;URL&gt;#&lt;head&gt;</code></pre>
Junio C Hamano249572f2006-10-24 05:44:081641</div></div>
Junio C Hamano59a32b02021-12-10 22:53:381642<div class="paragraph"><p><code>&lt;URL&gt;</code> is required; <code>#&lt;head&gt;</code> is optional.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591643<div class="paragraph"><p>Depending on the operation, git will use one of the following
1644refspecs, if you don&#8217;t provide one on the command line.
Junio C Hamanoc14e6ad2014-10-31 20:25:531645<code>&lt;branch&gt;</code> is the name of this file in <code>$GIT_DIR/branches</code> and
1646<code>&lt;head&gt;</code> defaults to <code>master</code>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591647<div class="paragraph"><p>git fetch uses:</p></div>
Junio C Hamano1caaf472006-12-31 08:29:351648<div class="listingblock">
Junio C Hamano1a4e8412005-12-27 08:17:231649<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531650<pre><code> refs/heads/&lt;head&gt;:refs/heads/&lt;branch&gt;</code></pre>
Junio C Hamano28363492008-11-14 08:26:311651</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591652<div class="paragraph"><p>git push uses:</p></div>
Junio C Hamano28363492008-11-14 08:26:311653<div class="listingblock">
1654<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531655<pre><code> HEAD:refs/heads/&lt;head&gt;</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231656</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:231657</div>
Junio C Hamano9d971152012-12-19 00:43:111658</div>
1659</div>
1660<div class="sect1">
Junio C Hamano45f804f2014-06-20 22:24:491661<h2 id="_configured_remote_tracking_branches_a_id_crtb_a">CONFIGURED REMOTE-TRACKING BRANCHES<a id="CRTB"></a></h2>
1662<div class="sectionbody">
1663<div class="paragraph"><p>You often interact with the same remote repository by
1664regularly and repeatedly fetching from it. In order to keep track
Junio C Hamanoc14e6ad2014-10-31 20:25:531665of the progress of such a remote repository, <code>git fetch</code> allows you
1666to configure <code>remote.&lt;repository&gt;.fetch</code> configuration variables.</p></div>
Junio C Hamano45f804f2014-06-20 22:24:491667<div class="paragraph"><p>Typically such a variable may look like this:</p></div>
1668<div class="listingblock">
1669<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531670<pre><code>[remote "origin"]
1671 fetch = +refs/heads/*:refs/remotes/origin/*</code></pre>
Junio C Hamano45f804f2014-06-20 22:24:491672</div></div>
1673<div class="paragraph"><p>This configuration is used in two ways:</p></div>
1674<div class="ulist"><ul>
1675<li>
1676<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531677When <code>git fetch</code> is run without specifying what branches
1678 and/or tags to fetch on the command line, e.g. <code>git fetch origin</code>
1679 or <code>git fetch</code>, <code>remote.&lt;repository&gt;.fetch</code> values are used as
Junio C Hamanoee615802015-10-29 21:45:261680 the refspecs&#8212;they specify which refs to fetch and which local refs
Junio C Hamano45f804f2014-06-20 22:24:491681 to update. The example above will fetch
Junio C Hamanoc14e6ad2014-10-31 20:25:531682 all branches that exist in the <code>origin</code> (i.e. any ref that matches
1683 the left-hand side of the value, <code>refs/heads/*</code>) and update the
1684 corresponding remote-tracking branches in the <code>refs/remotes/origin/*</code>
Junio C Hamano45f804f2014-06-20 22:24:491685 hierarchy.
1686</p>
1687</li>
1688<li>
1689<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531690When <code>git fetch</code> is run with explicit branches and/or tags
1691 to fetch on the command line, e.g. <code>git fetch origin master</code>, the
Junio C Hamano45f804f2014-06-20 22:24:491692 &lt;refspec&gt;s given on the command line determine what are to be
Junio C Hamanoc14e6ad2014-10-31 20:25:531693 fetched (e.g. <code>master</code> in the example,
1694 which is a short-hand for <code>master:</code>, which in turn means
Junio C Hamano45f804f2014-06-20 22:24:491695 "fetch the <em>master</em> branch but I do not explicitly say what
1696 remote-tracking branch to update with it from the command line"),
1697 and the example command will
Junio C Hamanoc14e6ad2014-10-31 20:25:531698 fetch <em>only</em> the <em>master</em> branch. The <code>remote.&lt;repository&gt;.fetch</code>
Junio C Hamano45f804f2014-06-20 22:24:491699 values determine which
1700 remote-tracking branch, if any, is updated. When used in this
Junio C Hamanoc14e6ad2014-10-31 20:25:531701 way, the <code>remote.&lt;repository&gt;.fetch</code> values do not have any
Junio C Hamano45f804f2014-06-20 22:24:491702 effect in deciding <em>what</em> gets fetched (i.e. the values are not
1703 used as refspecs when the command-line lists refspecs); they are
1704 only used to decide <em>where</em> the refs that are fetched are stored
1705 by acting as a mapping.
1706</p>
1707</li>
1708</ul></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531709<div class="paragraph"><p>The latter use of the <code>remote.&lt;repository&gt;.fetch</code> values can be
1710overridden by giving the <code>--refmap=&lt;refspec&gt;</code> parameter(s) on the
Junio C Hamano45f804f2014-06-20 22:24:491711command line.</p></div>
1712</div>
1713</div>
1714<div class="sect1">
Junio C Hamano664750f2018-03-06 23:25:441715<h2 id="_pruning">PRUNING</h2>
1716<div class="sectionbody">
1717<div class="paragraph"><p>Git has a default disposition of keeping data unless it&#8217;s explicitly
1718thrown away; this extends to holding onto local references to branches
1719on remotes that have themselves deleted those branches.</p></div>
1720<div class="paragraph"><p>If left to accumulate, these stale references might make performance
1721worse on big and busy repos that have a lot of branch churn, and
1722e.g. make the output of commands like <code>git branch -a --contains
1723&lt;commit&gt;</code> needlessly verbose, as well as impacting anything else
1724that&#8217;ll work with the complete set of known references.</p></div>
1725<div class="paragraph"><p>These remote-tracking references can be deleted as a one-off with
1726either of:</p></div>
1727<div class="listingblock">
1728<div class="content">
1729<pre><code># While fetching
1730$ git fetch --prune &lt;name&gt;
1731
1732# Only prune, don't fetch
1733$ git remote prune &lt;name&gt;</code></pre>
1734</div></div>
1735<div class="paragraph"><p>To prune references as part of your normal workflow without needing to
1736remember to run that, set <code>fetch.prune</code> globally, or
1737<code>remote.&lt;name&gt;.prune</code> per-remote in the config. See
1738<a href="git-config.html">git-config(1)</a>.</p></div>
1739<div class="paragraph"><p>Here&#8217;s where things get tricky and more specific. The pruning feature
Junio C Hamano2e5fb402021-08-04 21:41:111740doesn&#8217;t actually care about branches, instead it&#8217;ll prune local &#8592;&#8594;
Junio C Hamano664750f2018-03-06 23:25:441741remote-references as a function of the refspec of the remote (see
1742<code>&lt;refspec&gt;</code> and <a href="#CRTB">CONFIGURED REMOTE-TRACKING BRANCHES</a> above).</p></div>
1743<div class="paragraph"><p>Therefore if the refspec for the remote includes
1744e.g. <code>refs/tags/*:refs/tags/*</code>, or you manually run e.g. <code>git fetch
1745--prune &lt;name&gt; "refs/tags/*:refs/tags/*"</code> it won&#8217;t be stale remote
1746tracking branches that are deleted, but any local tag that doesn&#8217;t
1747exist on the remote.</p></div>
1748<div class="paragraph"><p>This might not be what you expect, i.e. you want to prune remote
1749<code>&lt;name&gt;</code>, but also explicitly fetch tags from it, so when you fetch
1750from it you delete all your local tags, most of which may not have
1751come from the <code>&lt;name&gt;</code> remote in the first place.</p></div>
1752<div class="paragraph"><p>So be careful when using this with a refspec like
1753<code>refs/tags/*:refs/tags/*</code>, or any other refspec which might map
1754references from multiple remotes to the same local namespace.</p></div>
1755<div class="paragraph"><p>Since keeping up-to-date with both branches and tags on the remote is
1756a common use-case the <code>--prune-tags</code> option can be supplied along with
1757<code>--prune</code> to prune local tags that don&#8217;t exist on the remote, and
1758force-update those tags that differ. Tag pruning can also be enabled
1759with <code>fetch.pruneTags</code> or <code>remote.&lt;name&gt;.pruneTags</code> in the config. See
1760<a href="git-config.html">git-config(1)</a>.</p></div>
1761<div class="paragraph"><p>The <code>--prune-tags</code> option is equivalent to having
1762<code>refs/tags/*:refs/tags/*</code> declared in the refspecs of the remote. This
1763can lead to some seemingly strange interactions:</p></div>
1764<div class="listingblock">
1765<div class="content">
1766<pre><code># These both fetch tags
1767$ git fetch --no-tags origin 'refs/tags/*:refs/tags/*'
1768$ git fetch --no-tags --prune-tags origin</code></pre>
1769</div></div>
1770<div class="paragraph"><p>The reason it doesn&#8217;t error out when provided without <code>--prune</code> or its
1771config versions is for flexibility of the configured versions, and to
1772maintain a 1=1 mapping between what the command line flags do, and
1773what the configuration versions do.</p></div>
1774<div class="paragraph"><p>It&#8217;s reasonable to e.g. configure <code>fetch.pruneTags=true</code> in
1775<code>~/.gitconfig</code> to have tags pruned whenever <code>git fetch --prune</code> is
1776run, without making every invocation of <code>git fetch</code> without <code>--prune</code>
1777an error.</p></div>
1778<div class="paragraph"><p>Pruning tags with <code>--prune-tags</code> also works when fetching a URL
1779instead of a named remote. These will all prune tags not found on
1780origin:</p></div>
1781<div class="listingblock">
1782<div class="content">
1783<pre><code>$ git fetch origin --prune --prune-tags
1784$ git fetch origin --prune 'refs/tags/*:refs/tags/*'
1785$ git fetch &lt;url of origin&gt; --prune --prune-tags
1786$ git fetch &lt;url of origin&gt; --prune 'refs/tags/*:refs/tags/*'</code></pre>
1787</div></div>
1788</div>
1789</div>
1790<div class="sect1">
Junio C Hamano1a1b8472016-07-19 21:37:131791<h2 id="_output">OUTPUT</h2>
1792<div class="sectionbody">
1793<div class="paragraph"><p>The output of "git fetch" depends on the transport method used; this
1794section describes the output when fetching over the Git protocol
1795(either locally or via ssh) and Smart HTTP protocol.</p></div>
1796<div class="paragraph"><p>The status of the fetch is output in tabular form, with each line
1797representing the status of a single ref. Each line is of the form:</p></div>
1798<div class="listingblock">
1799<div class="content">
1800<pre><code> &lt;flag&gt; &lt;summary&gt; &lt;from&gt; -&gt; &lt;to&gt; [&lt;reason&gt;]</code></pre>
1801</div></div>
Junio C Hamanod37473e2023-05-15 23:04:431802<div class="paragraph"><p>When using <code>--porcelain</code>, the output format is intended to be
1803machine-parseable. In contrast to the human-readable output formats it
1804thus prints to standard output instead of standard error. Each line is
1805of the form:</p></div>
1806<div class="listingblock">
1807<div class="content">
1808<pre><code>&lt;flag&gt; &lt;old-object-id&gt; &lt;new-object-id&gt; &lt;local-reference&gt;</code></pre>
1809</div></div>
Junio C Hamano1a1b8472016-07-19 21:37:131810<div class="paragraph"><p>The status of up-to-date refs is shown only if the --verbose option is
1811used.</p></div>
1812<div class="paragraph"><p>In compact output mode, specified with configuration variable
1813fetch.output, if either entire <code>&lt;from&gt;</code> or <code>&lt;to&gt;</code> is found in the
1814other string, it will be substituted with <code>*</code> in the other string. For
1815example, <code>master -&gt; origin/master</code> becomes <code>master -&gt; origin/*</code>.</p></div>
1816<div class="dlist"><dl>
1817<dt class="hdlist1">
1818flag
1819</dt>
1820<dd>
1821<p>
1822 A single character indicating the status of the ref:
1823</p>
1824<div class="dlist"><dl>
1825<dt class="hdlist1">
1826(space)
1827</dt>
1828<dd>
1829<p>
1830for a successfully fetched fast-forward;
1831</p>
1832</dd>
1833<dt class="hdlist1">
1834<code>+</code>
1835</dt>
1836<dd>
1837<p>
1838for a successful forced update;
1839</p>
1840</dd>
1841<dt class="hdlist1">
1842<code>-</code>
1843</dt>
1844<dd>
1845<p>
1846for a successfully pruned ref;
1847</p>
1848</dd>
1849<dt class="hdlist1">
1850<code>t</code>
1851</dt>
1852<dd>
1853<p>
1854for a successful tag update;
1855</p>
1856</dd>
1857<dt class="hdlist1">
1858<code>*</code>
1859</dt>
1860<dd>
1861<p>
1862for a successfully fetched new ref;
1863</p>
1864</dd>
1865<dt class="hdlist1">
1866<code>!</code>
1867</dt>
1868<dd>
1869<p>
1870for a ref that was rejected or failed to update; and
1871</p>
1872</dd>
1873<dt class="hdlist1">
1874<code>=</code>
1875</dt>
1876<dd>
1877<p>
1878for a ref that was up to date and did not need fetching.
1879</p>
1880</dd>
1881</dl></div>
1882</dd>
1883<dt class="hdlist1">
1884summary
1885</dt>
1886<dd>
1887<p>
1888 For a successfully fetched ref, the summary shows the old and new
1889 values of the ref in a form suitable for using as an argument to
1890 <code>git log</code> (this is <code>&lt;old&gt;..&lt;new&gt;</code> in most cases, and
1891 <code>&lt;old&gt;...&lt;new&gt;</code> for forced non-fast-forward updates).
1892</p>
1893</dd>
1894<dt class="hdlist1">
1895from
1896</dt>
1897<dd>
1898<p>
1899 The name of the remote ref being fetched from, minus its
1900 <code>refs/&lt;type&gt;/</code> prefix. In the case of deletion, the name of
1901 the remote ref is "(none)".
1902</p>
1903</dd>
1904<dt class="hdlist1">
1905to
1906</dt>
1907<dd>
1908<p>
1909 The name of the local ref being updated, minus its
1910 <code>refs/&lt;type&gt;/</code> prefix.
1911</p>
1912</dd>
1913<dt class="hdlist1">
1914reason
1915</dt>
1916<dd>
1917<p>
1918 A human-readable explanation. In the case of successfully fetched
1919 refs, no explanation is needed. For a failed ref, the reason for
1920 failure is described.
1921</p>
1922</dd>
1923</dl></div>
1924</div>
1925</div>
1926<div class="sect1">
Junio C Hamanoc21ab052009-10-31 04:03:551927<h2 id="_examples">EXAMPLES</h2>
1928<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591929<div class="ulist"><ul>
Junio C Hamanoc21ab052009-10-31 04:03:551930<li>
1931<p>
1932Update the remote-tracking branches:
1933</p>
1934<div class="listingblock">
1935<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531936<pre><code>$ git fetch origin</code></pre>
Junio C Hamanoc21ab052009-10-31 04:03:551937</div></div>
Junio C Hamanoa75aada2023-01-22 01:54:301938<div class="paragraph"><p>The above command copies all branches from the remote <code>refs/heads/</code>
1939namespace and stores them to the local <code>refs/remotes/origin/</code> namespace,
1940unless the <code>remote.&lt;repository&gt;.fetch</code> option is used to specify a
1941non-default refspec.</p></div>
Junio C Hamanoc21ab052009-10-31 04:03:551942</li>
1943<li>
1944<p>
1945Using refspecs explicitly:
1946</p>
1947<div class="listingblock">
1948<div class="content">
Junio C Hamanoa8911782020-07-07 05:35:571949<pre><code>$ git fetch origin +seen:seen maint:tmp</code></pre>
Junio C Hamanoc21ab052009-10-31 04:03:551950</div></div>
Junio C Hamanoa8911782020-07-07 05:35:571951<div class="paragraph"><p>This updates (or creates, as necessary) branches <code>seen</code> and <code>tmp</code> in
Junio C Hamanoc21ab052009-10-31 04:03:551952the local repository by fetching from the branches (respectively)
Junio C Hamanoa8911782020-07-07 05:35:571953<code>seen</code> and <code>maint</code> from the remote repository.</p></div>
1954<div class="paragraph"><p>The <code>seen</code> branch will be updated even if it does not fast-forward,
Junio C Hamanoc14e6ad2014-10-31 20:25:531955because it is prefixed with a plus sign; <code>tmp</code> will not be.</p></div>
Junio C Hamanoc21ab052009-10-31 04:03:551956</li>
Junio C Hamano45f804f2014-06-20 22:24:491957<li>
1958<p>
1959Peek at a remote&#8217;s branch, without configuring the remote in your local
Junio C Hamano2567b322019-02-05 23:33:561960 repository:
Junio C Hamano45f804f2014-06-20 22:24:491961</p>
1962<div class="listingblock">
1963<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531964<pre><code>$ git fetch git://git.kernel.org/pub/scm/git/git.git maint
1965$ git log FETCH_HEAD</code></pre>
Junio C Hamano45f804f2014-06-20 22:24:491966</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531967<div class="paragraph"><p>The first command fetches the <code>maint</code> branch from the repository at
1968<code>git://git.kernel.org/pub/scm/git/git.git</code> and the second command uses
1969<code>FETCH_HEAD</code> to examine the branch with <a href="git-log.html">git-log(1)</a>. The fetched
Junio C Hamano45f804f2014-06-20 22:24:491970objects will eventually be removed by git&#8217;s built-in housekeeping (see
1971<a href="git-gc.html">git-gc(1)</a>).</p></div>
1972</li>
Junio C Hamanoc21ab052009-10-31 04:03:551973</ul></div>
1974</div>
Junio C Hamano9d971152012-12-19 00:43:111975</div>
1976<div class="sect1">
Junio C Hamano56ace3d2017-01-10 23:43:411977<h2 id="_security">SECURITY</h2>
1978<div class="sectionbody">
1979<div class="paragraph"><p>The fetch and push protocols are not designed to prevent one side from
1980stealing data from the other repository that was not intended to be
1981shared. If you have private data that you need to protect from a malicious
1982peer, your best option is to store it in another repository. This applies
1983to both clients and servers. In particular, namespaces on a server are not
1984effective for read access control; you should only grant read access to a
1985namespace to clients that you would trust with read access to the entire
1986repository.</p></div>
1987<div class="paragraph"><p>The known attack vectors are as follows:</p></div>
1988<div class="olist arabic"><ol class="arabic">
1989<li>
1990<p>
1991The victim sends "have" lines advertising the IDs of objects it has that
1992 are not explicitly intended to be shared but can be used to optimize the
1993 transfer if the peer also has them. The attacker chooses an object ID X
1994 to steal and sends a ref to X, but isn&#8217;t required to send the content of
1995 X because the victim already has it. Now the victim believes that the
1996 attacker has X, and it sends the content of X back to the attacker
1997 later. (This attack is most straightforward for a client to perform on a
1998 server, by creating a ref to X in the namespace the client has access
1999 to and then fetching it. The most likely way for a server to perform it
2000 on a client is to "merge" X into a public branch and hope that the user
2001 does additional work on this branch and pushes it back to the server
2002 without noticing the merge.)
2003</p>
2004</li>
2005<li>
2006<p>
2007As in #1, the attacker chooses an object ID X to steal. The victim sends
2008 an object Y that the attacker already has, and the attacker falsely
2009 claims to have X and not Y, so the victim sends Y as a delta against X.
2010 The delta reveals regions of X that are similar to Y to the attacker.
2011</p>
2012</li>
2013</ol></div>
2014</div>
2015</div>
2016<div class="sect1">
Junio C Hamanoba8baee2022-09-14 20:25:232017<h2 id="_configuration">CONFIGURATION</h2>
2018<div class="sectionbody">
2019<div class="paragraph"><p>Everything below this line in this section is selectively included
2020from the <a href="git-config.html">git-config(1)</a> documentation. The content is the same
2021as what&#8217;s found there:</p></div>
2022<div class="dlist"><dl>
2023<dt class="hdlist1">
2024fetch.recurseSubmodules
2025</dt>
2026<dd>
2027<p>
2028 This option controls whether <code>git fetch</code> (and the underlying fetch
2029 in <code>git pull</code>) will recursively fetch into populated submodules.
2030 This option can be set either to a boolean value or to <em>on-demand</em>.
2031 Setting it to a boolean changes the behavior of fetch and pull to
2032 recurse unconditionally into submodules when set to true or to not
2033 recurse at all when set to false. When set to <em>on-demand</em>, fetch and
2034 pull will only recurse into a populated submodule when its
2035 superproject retrieves a commit that updates the submodule&#8217;s
2036 reference.
2037 Defaults to <em>on-demand</em>, or to the value of <em>submodule.recurse</em> if set.
2038</p>
2039</dd>
2040<dt class="hdlist1">
2041fetch.fsckObjects
2042</dt>
2043<dd>
2044<p>
2045 If it is set to true, git-fetch-pack will check all fetched
2046 objects. See <code>transfer.fsckObjects</code> for what&#8217;s
2047 checked. Defaults to false. If not set, the value of
2048 <code>transfer.fsckObjects</code> is used instead.
2049</p>
2050</dd>
2051<dt class="hdlist1">
2052fetch.fsck.&lt;msg-id&gt;
2053</dt>
2054<dd>
2055<p>
2056 Acts like <code>fsck.&lt;msg-id&gt;</code>, but is used by
2057 <a href="git-fetch-pack.html">git-fetch-pack(1)</a> instead of <a href="git-fsck.html">git-fsck(1)</a>. See
2058 the <code>fsck.&lt;msg-id&gt;</code> documentation for details.
2059</p>
2060</dd>
2061<dt class="hdlist1">
2062fetch.fsck.skipList
2063</dt>
2064<dd>
2065<p>
2066 Acts like <code>fsck.skipList</code>, but is used by
2067 <a href="git-fetch-pack.html">git-fetch-pack(1)</a> instead of <a href="git-fsck.html">git-fsck(1)</a>. See
2068 the <code>fsck.skipList</code> documentation for details.
2069</p>
2070</dd>
2071<dt class="hdlist1">
2072fetch.unpackLimit
2073</dt>
2074<dd>
2075<p>
2076 If the number of objects fetched over the Git native
2077 transfer is below this
2078 limit, then the objects will be unpacked into loose object
2079 files. However if the number of received objects equals or
2080 exceeds this limit then the received pack will be stored as
2081 a pack, after adding any missing delta bases. Storing the
2082 pack from a push can make the push operation complete faster,
2083 especially on slow filesystems. If not set, the value of
2084 <code>transfer.unpackLimit</code> is used instead.
2085</p>
2086</dd>
2087<dt class="hdlist1">
2088fetch.prune
2089</dt>
2090<dd>
2091<p>
2092 If true, fetch will automatically behave as if the <code>--prune</code>
2093 option was given on the command line. See also <code>remote.&lt;name&gt;.prune</code>
2094 and the PRUNING section of <a href="git-fetch.html">git-fetch(1)</a>.
2095</p>
2096</dd>
2097<dt class="hdlist1">
2098fetch.pruneTags
2099</dt>
2100<dd>
2101<p>
2102 If true, fetch will automatically behave as if the
2103 <code>refs/tags/*:refs/tags/*</code> refspec was provided when pruning,
2104 if not set already. This allows for setting both this option
2105 and <code>fetch.prune</code> to maintain a 1=1 mapping to upstream
2106 refs. See also <code>remote.&lt;name&gt;.pruneTags</code> and the PRUNING
2107 section of <a href="git-fetch.html">git-fetch(1)</a>.
2108</p>
2109</dd>
2110<dt class="hdlist1">
2111fetch.output
2112</dt>
2113<dd>
2114<p>
2115 Control how ref update status is printed. Valid values are
2116 <code>full</code> and <code>compact</code>. Default value is <code>full</code>. See section
2117 OUTPUT in <a href="git-fetch.html">git-fetch(1)</a> for detail.
2118</p>
2119</dd>
2120<dt class="hdlist1">
2121fetch.negotiationAlgorithm
2122</dt>
2123<dd>
2124<p>
2125 Control how information about the commits in the local repository
2126 is sent when negotiating the contents of the packfile to be sent by
2127 the server. Set to "consecutive" to use an algorithm that walks
2128 over consecutive commits checking each one. Set to "skipping" to
2129 use an algorithm that skips commits in an effort to converge
2130 faster, but may result in a larger-than-necessary packfile; or set
2131 to "noop" to not send any information at all, which will almost
2132 certainly result in a larger-than-necessary packfile, but will skip
2133 the negotiation step. Set to "default" to override settings made
2134 previously and use the default behaviour. The default is normally
2135 "consecutive", but if <code>feature.experimental</code> is true, then the
2136 default is "skipping". Unknown values will cause <em>git fetch</em> to
2137 error out.
2138</p>
2139<div class="paragraph"><p>See also the <code>--negotiate-only</code> and <code>--negotiation-tip</code> options to
2140<a href="git-fetch.html">git-fetch(1)</a>.</p></div>
2141</dd>
2142<dt class="hdlist1">
2143fetch.showForcedUpdates
2144</dt>
2145<dd>
2146<p>
2147 Set to false to enable <code>--no-show-forced-updates</code> in
2148 <a href="git-fetch.html">git-fetch(1)</a> and <a href="git-pull.html">git-pull(1)</a> commands.
2149 Defaults to true.
2150</p>
2151</dd>
2152<dt class="hdlist1">
2153fetch.parallel
2154</dt>
2155<dd>
2156<p>
2157 Specifies the maximal number of fetch operations to be run in parallel
2158 at a time (submodules, or remotes when the <code>--multiple</code> option of
2159 <a href="git-fetch.html">git-fetch(1)</a> is in effect).
2160</p>
2161<div class="paragraph"><p>A value of 0 will give some reasonable default. If unset, it defaults to 1.</p></div>
2162<div class="paragraph"><p>For submodules, this setting can be overridden using the <code>submodule.fetchJobs</code>
2163config setting.</p></div>
2164</dd>
2165<dt class="hdlist1">
2166fetch.writeCommitGraph
2167</dt>
2168<dd>
2169<p>
2170 Set to true to write a commit-graph after every <code>git fetch</code> command
2171 that downloads a pack-file from a remote. Using the <code>--split</code> option,
2172 most executions will create a very small commit-graph file on top of
2173 the existing commit-graph file(s). Occasionally, these files will
2174 merge and the write may take longer. Having an updated commit-graph
2175 file helps performance of many Git commands, including <code>git merge-base</code>,
2176 <code>git push -f</code>, and <code>git log --graph</code>. Defaults to false.
2177</p>
2178</dd>
Junio C Hamano3583c5c2023-02-22 23:31:592179<dt class="hdlist1">
2180fetch.bundleURI
2181</dt>
2182<dd>
2183<p>
2184 This value stores a URI for downloading Git object data from a bundle
2185 URI before performing an incremental fetch from the origin Git server.
2186 This is similar to how the <code>--bundle-uri</code> option behaves in
2187 <a href="git-clone.html">git-clone(1)</a>. <code>git clone --bundle-uri</code> will set the
2188 <code>fetch.bundleURI</code> value if the supplied bundle URI contains a bundle
2189 list that is organized for incremental fetches.
2190</p>
2191<div class="paragraph"><p>If you modify this value and your repository has a <code>fetch.bundleCreationToken</code>
2192value, then remove that <code>fetch.bundleCreationToken</code> value before fetching from
2193the new bundle URI.</p></div>
2194</dd>
2195<dt class="hdlist1">
2196fetch.bundleCreationToken
2197</dt>
2198<dd>
2199<p>
2200 When using <code>fetch.bundleURI</code> to fetch incrementally from a bundle
2201 list that uses the "creationToken" heuristic, this config value
2202 stores the maximum <code>creationToken</code> value of the downloaded bundles.
2203 This value is used to prevent downloading bundles in the future
2204 if the advertised <code>creationToken</code> is not strictly larger than this
2205 value.
2206</p>
2207<div class="paragraph"><p>The creation token values are chosen by the provider serving the specific
2208bundle URI. If you modify the URI at <code>fetch.bundleURI</code>, then be sure to
2209remove the value for the <code>fetch.bundleCreationToken</code> value before fetching.</p></div>
2210</dd>
Junio C Hamanoba8baee2022-09-14 20:25:232211</dl></div>
2212</div>
2213</div>
2214<div class="sect1">
Junio C Hamano5cd15182011-04-05 00:21:102215<h2 id="_bugs">BUGS</h2>
2216<div class="sectionbody">
Junio C Hamano67fef492022-03-27 17:31:232217<div class="paragraph"><p>Using --recurse-submodules can only fetch new commits in submodules that are
2218present locally e.g. in <code>$GIT_DIR/modules/</code>. If the upstream adds a new
2219submodule, that submodule cannot be fetched until it is cloned e.g. by <code>git
2220submodule update</code>. This is expected to be fixed in a future Git version.</p></div>
Junio C Hamano5cd15182011-04-05 00:21:102221</div>
Junio C Hamano9d971152012-12-19 00:43:112222</div>
2223<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312224<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232225<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232226<div class="paragraph"><p><a href="git-pull.html">git-pull(1)</a></p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232227</div>
Junio C Hamano9d971152012-12-19 00:43:112228</div>
2229<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312230<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:232231<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232232<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:232233</div>
Junio C Hamano7bd050f2011-09-22 06:32:222234</div>
Junio C Hamano9d971152012-12-19 00:43:112235</div>
Junio C Hamano7bd050f2011-09-22 06:32:222236<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:232237<div id="footer">
2238<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:532239Last updated
Junio C Hamanoa7b2c102023-06-13 21:00:152240 2023-05-15 16:02:03 PDT
Junio C Hamano1a4e8412005-12-27 08:17:232241</div>
2242</div>
2243</body>
2244</html>