blob: 56d2e3d6de7c6ce96fc45db713e48698c372f5e9 [file] [log] [blame]
Junio C Hamanoccb82522018-05-08 07:52:091<?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 Hamanoccb82522018-05-08 07:52:097<meta name="generator" content="AsciiDoc 8.6.10" />
Junio C Hamano68cf15a2010-11-06 01:01:598<title>git-clone(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 Hamano7bd050f2011-09-22 06:32:22542var 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;
Junio C Hamanoc14e6ad2014-10-31 20:25:53583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22584 // 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");
Junio C Hamano9d971152012-12-19 00:43:11603 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];
Junio C Hamanoc14e6ad2014-10-31 20:25:53612 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9d971152012-12-19 00:43:11613 && 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.
Junio C Hamano7bd050f2011-09-22 06:32:22622 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 () {
Junio C Hamano9d971152012-12-19 00:43:11649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22651 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9d971152012-12-19 00:43:11659 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");
Junio C Hamano7bd050f2011-09-22 06:32:22667 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++;
Junio C Hamano9d971152012-12-19 00:43:11673 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 }
Junio C Hamano7bd050f2011-09-22 06:32:22683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22687 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 }
Junio C Hamano9d971152012-12-19 00:43:11706},
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;
Junio C Hamano7bd050f2011-09-22 06:32:22728}
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-clone(1) Manual Page
739</h1>
740<h2>NAME</h2>
741<div class="sectionbody">
742<p>git-clone -
Junio C Hamano4ec06712007-06-09 20:39:33743 Clone a repository into a new directory
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 Hamano235a91e2006-01-07 01:13:58751<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11752<pre class="content"><em>git clone</em> [--template=&lt;template_directory&gt;]
Junio C Hamanoaf1987f2008-08-03 07:58:19753 [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
Junio C Hamano2bd8a742009-12-01 21:16:59754 [-o &lt;name&gt;] [-b &lt;name&gt;] [-u &lt;upload-pack&gt;] [--reference &lt;repository&gt;]
Junio C Hamanoc9394b22015-01-07 22:45:48755 [--dissociate] [--separate-git-dir &lt;git dir&gt;]
Junio C Hamanod5176902017-05-16 04:30:56756 [--depth &lt;depth&gt;] [--[no-]single-branch] [--no-tags]
Junio C Hamano047135e2017-12-19 21:57:54757 [--recurse-submodules[=&lt;pathspec&gt;]] [--[no-]shallow-submodules]
Junio C Hamano2f5a9892019-12-25 21:12:55758 [--[no-]remote-submodules] [--jobs &lt;n&gt;] [--sparse] [--] &lt;repository&gt;
Junio C Hamano73c64862019-06-18 03:24:20759 [&lt;directory&gt;]</pre>
Junio C Hamano9d971152012-12-19 00:43:11760<div class="attribution">
Junio C Hamano68cf15a2010-11-06 01:01:59761</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23762</div>
Junio C Hamano9d971152012-12-19 00:43:11763</div>
764<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31765<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23766<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59767<div class="paragraph"><p>Clones a repository into a newly created directory, creates
Junio C Hamano5102d9a2006-12-08 07:23:46768remote-tracking branches for each branch in the cloned repository
Junio C Hamano0906e982019-07-12 20:33:43769(visible using <code>git branch --remotes</code>), and creates and checks out an
Junio C Hamano68cf15a2010-11-06 01:01:59770initial branch that is forked from the cloned repository&#8217;s
Junio C Hamanoc0e55e72009-10-10 00:56:29771currently active branch.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53772<div class="paragraph"><p>After the clone, a plain <code>git fetch</code> without arguments will update
773all the remote-tracking branches, and a <code>git pull</code> without
Junio C Hamano5102d9a2006-12-08 07:23:46774arguments will in addition merge the remote master branch into the
Junio C Hamano6a8a8482012-10-01 20:59:41775current master branch, if any (this is untrue when "--single-branch"
776is given; see below).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59777<div class="paragraph"><p>This default configuration is achieved by creating references to
Junio C Hamanoc14e6ad2014-10-31 20:25:53778the remote branch heads under <code>refs/remotes/origin</code> and
779by initializing <code>remote.origin.url</code> and <code>remote.origin.fetch</code>
Junio C Hamanoba4b9282008-07-06 05:20:31780configuration variables.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23781</div>
Junio C Hamano9d971152012-12-19 00:43:11782</div>
783<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31784<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23785<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59786<div class="dlist"><dl>
787<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43788-l
Junio C Hamano1a4e8412005-12-27 08:17:23789</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59790<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43791--local
Junio C Hamano1a4e8412005-12-27 08:17:23792</dt>
793<dd>
794<p>
795 When the repository to clone from is on a local machine,
Junio C Hamano076ffcc2013-02-06 05:13:21796 this flag bypasses the normal "Git aware" transport
Junio C Hamano1a4e8412005-12-27 08:17:23797 mechanism and clones the repository by making a copy of
798 HEAD and everything under objects and refs directories.
Junio C Hamanoc14e6ad2014-10-31 20:25:53799 The files under <code>.git/objects/</code> directory are hardlinked
Junio C Hamano7f2b3cb2012-06-22 22:42:39800 to save space when possible.
Junio C Hamanob1d6e882007-08-11 08:30:16801</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53802<div class="paragraph"><p>If the repository is specified as a local path (e.g., <code>/path/to/repo</code>),
Junio C Hamano7f2b3cb2012-06-22 22:42:39803this is the default, and --local is essentially a no-op. If the
804repository is specified as a URL, then this flag is ignored (and we
Junio C Hamanoc14e6ad2014-10-31 20:25:53805never use the local optimizations). Specifying <code>--no-local</code> will
806override the default when <code>/path/to/repo</code> is given, using the regular
Junio C Hamano076ffcc2013-02-06 05:13:21807Git transport instead.</p></div>
Junio C Hamanob1d6e882007-08-11 08:30:16808</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59809<dt class="hdlist1">
Junio C Hamanob1d6e882007-08-11 08:30:16810--no-hardlinks
811</dt>
812<dd>
813<p>
Junio C Hamano5b3533d2014-02-27 23:07:15814 Force the cloning process from a repository on a local
Junio C Hamanoc14e6ad2014-10-31 20:25:53815 filesystem to copy the files under the <code>.git/objects</code>
Junio C Hamano5b3533d2014-02-27 23:07:15816 directory instead of using hardlinks. This may be desirable
817 if you are trying to make a back-up of your repository.
Junio C Hamano1a4e8412005-12-27 08:17:23818</p>
819</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59820<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43821-s
Junio C Hamano1a4e8412005-12-27 08:17:23822</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59823<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43824--shared
Junio C Hamano1a4e8412005-12-27 08:17:23825</dt>
826<dd>
827<p>
828 When the repository to clone is on the local machine,
829 instead of using hard links, automatically setup
Junio C Hamanoc14e6ad2014-10-31 20:25:53830 <code>.git/objects/info/alternates</code> to share the objects
Junio C Hamano1a4e8412005-12-27 08:17:23831 with the source repository. The resulting repository
832 starts out without any object of its own.
833</p>
Junio C Hamano68cf15a2010-11-06 01:01:59834<div class="paragraph"><p><strong>NOTE</strong>: this is a possibly dangerous operation; do <strong>not</strong> use
Junio C Hamanoefe3c632008-02-14 00:51:31835it unless you understand what it does. If you clone your
Junio C Hamanoa9aee782008-04-23 16:09:20836repository using this option and then delete branches (or use any
Junio C Hamano076ffcc2013-02-06 05:13:21837other Git command that makes any existing commit unreferenced) in the
Junio C Hamanoa9aee782008-04-23 16:09:20838source repository, some objects may become unreferenced (or dangling).
Junio C Hamanoc14e6ad2014-10-31 20:25:53839These objects may be removed by normal Git operations (such as <code>git commit</code>)
840which automatically call <code>git gc --auto</code>. (See <a href="git-gc.html">git-gc(1)</a>.)
Junio C Hamanofce7c7e2008-07-02 03:06:38841If these objects are removed and were referenced by the cloned repository,
Junio C Hamanoba4b9282008-07-06 05:20:31842then the cloned repository will become corrupt.</p></div>
Junio C Hamano0906e982019-07-12 20:33:43843<div class="paragraph"><p>Note that running <code>git repack</code> without the <code>--local</code> option in a repository
844cloned with <code>--shared</code> will copy objects from the source repository into a pack
845in the cloned repository, removing the disk space savings of <code>clone --shared</code>.
846It is safe, however, to run <code>git gc</code>, which uses the <code>--local</code> option by
Junio C Hamanob9376922009-08-19 00:09:13847default.</p></div>
Junio C Hamano0906e982019-07-12 20:33:43848<div class="paragraph"><p>If you want to break the dependency of a repository cloned with <code>--shared</code> on
Junio C Hamanoc14e6ad2014-10-31 20:25:53849its source repository, you can simply run <code>git repack -a</code> to copy all
Junio C Hamanob9376922009-08-19 00:09:13850objects from the source repository into a pack in the cloned repository.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23851</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59852<dt class="hdlist1">
Junio C Hamanocd451662016-09-13 00:54:09853--reference[-if-able] &lt;repository&gt;
Junio C Hamanof50bfec2006-04-19 09:44:12854</dt>
855<dd>
856<p>
Junio C Hamano35b47ca2009-09-03 18:11:54857 If the reference repository is on the local machine,
Junio C Hamanoc14e6ad2014-10-31 20:25:53858 automatically setup <code>.git/objects/info/alternates</code> to
Junio C Hamanof50bfec2006-04-19 09:44:12859 obtain objects from the reference repository. Using
860 an already existing repository as an alternate will
Junio C Hamano250f03e2007-09-10 01:33:28861 require fewer objects to be copied from the repository
Junio C Hamanof50bfec2006-04-19 09:44:12862 being cloned, reducing network and local storage costs.
Junio C Hamanocd451662016-09-13 00:54:09863 When using the <code>--reference-if-able</code>, a non existing
864 directory is skipped with a warning instead of aborting
865 the clone.
Junio C Hamanof50bfec2006-04-19 09:44:12866</p>
Junio C Hamanoc9394b22015-01-07 22:45:48867<div class="paragraph"><p><strong>NOTE</strong>: see the NOTE for the <code>--shared</code> option, and also the
868<code>--dissociate</code> option.</p></div>
869</dd>
870<dt class="hdlist1">
871--dissociate
872</dt>
873<dd>
874<p>
875 Borrow the objects from reference repositories specified
876 with the <code>--reference</code> options only to reduce network
Junio C Hamano448d1322015-10-30 21:57:54877 transfer, and stop borrowing from them after a clone is made
878 by making necessary local copies of borrowed objects. This
879 option can also be used when cloning locally from a
880 repository that already borrows objects from another
881 repository&#8212;the new repository will borrow objects from the
882 same repository, and this option can be used to stop the
883 borrowing.
Junio C Hamanoc9394b22015-01-07 22:45:48884</p>
Junio C Hamanof50bfec2006-04-19 09:44:12885</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59886<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43887-q
Junio C Hamano1a4e8412005-12-27 08:17:23888</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59889<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43890--quiet
Junio C Hamano1a4e8412005-12-27 08:17:23891</dt>
892<dd>
893<p>
Junio C Hamano6ce6b6c2010-01-18 01:25:50894 Operate quietly. Progress is not reported to the standard
Junio C Hamanof85ef632016-02-17 22:31:06895 error stream.
Junio C Hamano1a4e8412005-12-27 08:17:23896</p>
897</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59898<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43899-v
Junio C Hamano7d06a8a2008-10-20 05:42:33900</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59901<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43902--verbose
Junio C Hamano7d06a8a2008-10-20 05:42:33903</dt>
904<dd>
905<p>
Junio C Hamanoea90ab32010-03-15 20:32:55906 Run verbosely. Does not affect the reporting of progress status
907 to the standard error stream.
Junio C Hamano6ce6b6c2010-01-18 01:25:50908</p>
909</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59910<dt class="hdlist1">
Junio C Hamano6ce6b6c2010-01-18 01:25:50911--progress
912</dt>
913<dd>
914<p>
915 Progress status is reported on the standard error stream
Junio C Hamano0906e982019-07-12 20:33:43916 by default when it is attached to a terminal, unless <code>--quiet</code>
Junio C Hamano6ce6b6c2010-01-18 01:25:50917 is specified. This flag forces progress status even if the
918 standard error stream is not directed to a terminal.
Junio C Hamano7d06a8a2008-10-20 05:42:33919</p>
920</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59921<dt class="hdlist1">
Junio C Hamanod1063b12019-05-08 17:18:07922--server-option=&lt;option&gt;
923</dt>
924<dd>
925<p>
926 Transmit the given string to the server when communicating using
927 protocol version 2. The given string must not contain a NUL or LF
928 character. The server&#8217;s handling of server options, including
929 unknown ones, is server-specific.
930 When multiple <code>--server-option=&lt;option&gt;</code> are given, they are all
931 sent to the other side in the order listed on the command line.
932</p>
933</dd>
934<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43935-n
Junio C Hamano1e6e0062007-07-13 05:33:25936</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59937<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43938--no-checkout
Junio C Hamano1a4e8412005-12-27 08:17:23939</dt>
940<dd>
941<p>
942 No checkout of HEAD is performed after the clone is complete.
943</p>
944</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59945<dt class="hdlist1">
Junio C Hamanoe663a7a2006-01-25 12:37:28946--bare
Junio C Hamano38064d52006-01-15 10:13:49947</dt>
948<dd>
949<p>
Junio C Hamano076ffcc2013-02-06 05:13:21950 Make a <em>bare</em> Git repository. That is, instead of
Junio C Hamanoc14e6ad2014-10-31 20:25:53951 creating <code>&lt;directory&gt;</code> and placing the administrative
952 files in <code>&lt;directory&gt;/.git</code>, make the <code>&lt;directory&gt;</code>
Junio C Hamano0906e982019-07-12 20:33:43953 itself the <code>$GIT_DIR</code>. This obviously implies the <code>--no-checkout</code>
Junio C Hamano9f292e72006-11-24 11:37:29954 because there is nowhere to check out the working tree.
955 Also the branch heads at the remote are copied directly
956 to corresponding local branch heads, without mapping
Junio C Hamanoc14e6ad2014-10-31 20:25:53957 them to <code>refs/remotes/origin/</code>. When this option is
Junio C Hamanod3361ad2007-01-01 03:20:24958 used, neither remote-tracking branches nor the related
959 configuration variables are created.
Junio C Hamano38064d52006-01-15 10:13:49960</p>
961</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59962<dt class="hdlist1">
Junio C Hamano2f5a9892019-12-25 21:12:55963--sparse
964</dt>
965<dd>
966<p>
967 Initialize the sparse-checkout file so the working
968 directory starts with only the files in the root
969 of the repository. The sparse-checkout file can be
970 modified to grow the working directory as needed.
971</p>
972</dd>
973<dt class="hdlist1">
Junio C Hamanoaf1987f2008-08-03 07:58:19974--mirror
975</dt>
976<dd>
977<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53978 Set up a mirror of the source repository. This implies <code>--bare</code>.
979 Compared to <code>--bare</code>, <code>--mirror</code> not only maps local branches of the
Junio C Hamano657fd8a2010-10-07 00:01:24980 source to local branches of the target, it maps all refs (including
Junio C Hamano97bcb482010-11-25 03:16:07981 remote-tracking branches, notes etc.) and sets up a refspec configuration such
Junio C Hamanoc14e6ad2014-10-31 20:25:53982 that all these refs are overwritten by a <code>git remote update</code> in the
Junio C Hamano657fd8a2010-10-07 00:01:24983 target repository.
Junio C Hamanoaf1987f2008-08-03 07:58:19984</p>
985</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59986<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43987-o &lt;name&gt;
Junio C Hamanodcc22ee2006-11-03 02:40:13988</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59989<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43990--origin &lt;name&gt;
Junio C Hamano1a4e8412005-12-27 08:17:23991</dt>
992<dd>
993<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53994 Instead of using the remote name <code>origin</code> to keep track
995 of the upstream repository, use <code>&lt;name&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:23996</p>
997</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59998<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:43999-b &lt;name&gt;
Junio C Hamanoc28068f2009-09-08 00:55:231000</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591001<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:431002--branch &lt;name&gt;
Junio C Hamanoc28068f2009-09-08 00:55:231003</dt>
1004<dd>
1005<p>
1006 Instead of pointing the newly created HEAD to the branch pointed
Junio C Hamanoc14e6ad2014-10-31 20:25:531007 to by the cloned repository&#8217;s HEAD, point to <code>&lt;name&gt;</code> branch
Junio C Hamano6a8a8482012-10-01 20:59:411008 instead. In a non-bare repository, this is the branch that will
1009 be checked out.
Junio C Hamanoc14e6ad2014-10-31 20:25:531010 <code>--branch</code> can also take tags and detaches the HEAD at that commit
Junio C Hamano6a8a8482012-10-01 20:59:411011 in the resulting repository.
Junio C Hamanoc28068f2009-09-08 00:55:231012</p>
1013</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591014<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:431015-u &lt;upload-pack&gt;
Junio C Hamano1a4e8412005-12-27 08:17:231016</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591017<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:431018--upload-pack &lt;upload-pack&gt;
Junio C Hamano1a4e8412005-12-27 08:17:231019</dt>
1020<dd>
1021<p>
Junio C Hamano3db8b412008-07-26 06:45:591022 When given, and the repository to clone from is accessed
1023 via ssh, this specifies a non-default path for the command
Junio C Hamano1a4e8412005-12-27 08:17:231024 run on the other end.
1025</p>
1026</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591027<dt class="hdlist1">
Junio C Hamanof31d9f52006-05-28 20:58:091028--template=&lt;template_directory&gt;
1029</dt>
1030<dd>
1031<p>
1032 Specify the directory from which templates will be used;
Junio C Hamanoa28a9202012-06-21 07:08:231033 (See the "TEMPLATE DIRECTORY" section of <a href="git-init.html">git-init(1)</a>.)
Junio C Hamanof31d9f52006-05-28 20:58:091034</p>
1035</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591036<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:431037-c &lt;key&gt;=&lt;value&gt;
Junio C Hamano708376e2011-07-19 20:02:131038</dt>
1039<dt class="hdlist1">
Junio C Hamano0906e982019-07-12 20:33:431040--config &lt;key&gt;=&lt;value&gt;
Junio C Hamano708376e2011-07-19 20:02:131041</dt>
1042<dd>
1043<p>
1044 Set a configuration variable in the newly-created repository;
1045 this takes effect immediately after the repository is
1046 initialized, but before the remote history is fetched or any
1047 files checked out. The key is in the same format as expected by
Junio C Hamanoc14e6ad2014-10-31 20:25:531048 <a href="git-config.html">git-config(1)</a> (e.g., <code>core.eol=true</code>). If multiple
Junio C Hamano708376e2011-07-19 20:02:131049 values are given for the same key, each value will be written to
1050 the config file. This makes it safe, for example, to add
1051 additional fetch refspecs to the origin remote.
1052</p>
Junio C Hamanode48f452019-01-04 22:31:571053<div class="paragraph"><p>Due to limitations of the current implementation, some configuration
1054variables do not take effect until after the initial fetch and checkout.
1055Configuration variables known to not take effect are:
1056<code>remote.&lt;name&gt;.mirror</code> and <code>remote.&lt;name&gt;.tagOpt</code>. Use the
1057corresponding <code>--mirror</code> and <code>--no-tags</code> options instead.</p></div>
Junio C Hamano708376e2011-07-19 20:02:131058</dd>
1059<dt class="hdlist1">
Junio C Hamano0bbd4672007-02-20 04:52:141060--depth &lt;depth&gt;
Junio C Hamanob288d9e2007-01-02 00:04:151061</dt>
1062<dd>
1063<p>
1064 Create a <em>shallow</em> clone with a history truncated to the
Junio C Hamano4e6ba272016-01-20 23:23:191065 specified number of commits. Implies <code>--single-branch</code> unless
1066 <code>--no-single-branch</code> is given to fetch the histories near the
Junio C Hamanoc6c919b2016-07-06 21:34:151067 tips of all branches. If you want to clone submodules shallowly,
1068 also pass <code>--shallow-submodules</code>.
Junio C Hamanob288d9e2007-01-02 00:04:151069</p>
1070</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591071<dt class="hdlist1">
Junio C Hamano20829a42016-10-10 23:24:441072--shallow-since=&lt;date&gt;
1073</dt>
1074<dd>
1075<p>
1076 Create a shallow clone with a history after the specified time.
1077</p>
1078</dd>
1079<dt class="hdlist1">
1080--shallow-exclude=&lt;revision&gt;
1081</dt>
1082<dd>
1083<p>
1084 Create a shallow clone with a history, excluding commits
1085 reachable from a specified remote branch or tag. This option
1086 can be specified multiple times.
1087</p>
1088</dd>
1089<dt class="hdlist1">
Junio C Hamano3d1b5a12013-05-17 23:34:021090--[no-]single-branch
Junio C Hamanob5be0522012-01-29 22:20:191091</dt>
1092<dd>
1093<p>
1094 Clone only the history leading to the tip of a single branch,
Junio C Hamanoc14e6ad2014-10-31 20:25:531095 either specified by the <code>--branch</code> option or the primary
Junio C Hamano4e6ba272016-01-20 23:23:191096 branch remote&#8217;s <code>HEAD</code> points at.
Junio C Hamano6a8a8482012-10-01 20:59:411097 Further fetches into the resulting repository will only update the
Junio C Hamanoa1295452012-11-13 22:32:041098 remote-tracking branch for the branch this option was used for the
Junio C Hamano6a8a8482012-10-01 20:59:411099 initial cloning. If the HEAD at the remote did not point at any
Junio C Hamanoc14e6ad2014-10-31 20:25:531100 branch when <code>--single-branch</code> clone was made, no remote-tracking
Junio C Hamano6a8a8482012-10-01 20:59:411101 branch is created.
Junio C Hamanob5be0522012-01-29 22:20:191102</p>
1103</dd>
1104<dt class="hdlist1">
Junio C Hamanod5176902017-05-16 04:30:561105--no-tags
1106</dt>
1107<dd>
1108<p>
1109 Don&#8217;t clone any tags, and set
1110 <code>remote.&lt;remote&gt;.tagOpt=--no-tags</code> in the config, ensuring
1111 that future <code>git pull</code> and <code>git fetch</code> operations won&#8217;t follow
1112 any tags. Subsequent explicit tag fetches will still work,
1113 (see <a href="git-fetch.html">git-fetch(1)</a>).
1114</p>
1115<div class="paragraph"><p>Can be used in conjunction with <code>--single-branch</code> to clone and
1116maintain a branch with no references other than a single cloned
1117branch. This is useful e.g. to maintain minimal clones of the default
1118branch of some repository for search indexing.</p></div>
1119</dd>
1120<dt class="hdlist1">
Junio C Hamanodc8d0c32017-03-30 23:00:211121--recurse-submodules[=&lt;pathspec]
Junio C Hamanoed69a742010-12-01 03:09:231122</dt>
Junio C Hamano0e066b92009-08-28 01:08:411123<dd>
1124<p>
Junio C Hamanodc8d0c32017-03-30 23:00:211125 After the clone is created, initialize and clone submodules
1126 within based on the provided pathspec. If no pathspec is
1127 provided, all submodules are initialized and cloned.
Junio C Hamano047135e2017-12-19 21:57:541128 This option can be given multiple times for pathspecs consisting
1129 of multiple entries. The resulting clone has <code>submodule.active</code> set to
Junio C Hamanodc8d0c32017-03-30 23:00:211130 the provided pathspec, or "." (meaning all submodules) if no
Junio C Hamano047135e2017-12-19 21:57:541131 pathspec is provided.
Junio C Hamano0e066b92009-08-28 01:08:411132</p>
Junio C Hamano047135e2017-12-19 21:57:541133<div class="paragraph"><p>Submodules are initialized and cloned using their default settings. This is
1134equivalent to running
1135<code>git submodule update --init --recursive &lt;pathspec&gt;</code> immediately after
1136the clone is finished. This option is ignored if the cloned repository does
1137not have a worktree/checkout (i.e. if any of <code>--no-checkout</code>/<code>-n</code>, <code>--bare</code>,
1138or <code>--mirror</code> is given)</p></div>
Junio C Hamano0e066b92009-08-28 01:08:411139</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591140<dt class="hdlist1">
Junio C Hamanoccdabca2016-05-06 22:27:091141--[no-]shallow-submodules
1142</dt>
1143<dd>
1144<p>
1145 All submodules which are cloned will be shallow with a depth of 1.
1146</p>
1147</dd>
1148<dt class="hdlist1">
Junio C Hamano73c64862019-06-18 03:24:201149--[no-]remote-submodules
1150</dt>
1151<dd>
1152<p>
Junio C Hamano2f5a9892019-12-25 21:12:551153 All submodules which are cloned will use the status of the submodule&#8217;s
Junio C Hamano73c64862019-06-18 03:24:201154 remote-tracking branch to update the submodule, rather than the
Junio C Hamano2f5a9892019-12-25 21:12:551155 superproject&#8217;s recorded SHA-1. Equivalent to passing <code>--remote</code> to
Junio C Hamano73c64862019-06-18 03:24:201156 <code>git submodule update</code>.
1157</p>
1158</dd>
1159<dt class="hdlist1">
Junio C Hamanoa03ac862011-04-02 04:32:291160--separate-git-dir=&lt;git dir&gt;
1161</dt>
1162<dd>
1163<p>
1164 Instead of placing the cloned repository where it is supposed
1165 to be, place the cloned repository at the specified directory,
Junio C Hamano826f5c42014-02-07 20:33:301166 then make a filesystem-agnostic Git symbolic link to there.
Junio C Hamano076ffcc2013-02-06 05:13:211167 The result is Git repository can be separated from working
Junio C Hamanoa03ac862011-04-02 04:32:291168 tree.
1169</p>
1170</dd>
1171<dt class="hdlist1">
Junio C Hamanobec5da42016-04-06 22:58:211172-j &lt;n&gt;
1173</dt>
1174<dt class="hdlist1">
1175--jobs &lt;n&gt;
1176</dt>
1177<dd>
1178<p>
1179 The number of submodules fetched at the same time.
1180 Defaults to the <code>submodule.fetchJobs</code> option.
1181</p>
1182</dd>
1183<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231184&lt;repository&gt;
1185</dt>
1186<dd>
1187<p>
Junio C Hamano330aae62007-07-06 17:01:581188 The (possibly remote) repository to clone from. See the
Junio C Hamanoccb82522018-05-08 07:52:091189 <a href="#URLS">GIT URLS</a> section below for more information on specifying
Junio C Hamano330aae62007-07-06 17:01:581190 repositories.
Junio C Hamano1a4e8412005-12-27 08:17:231191</p>
1192</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591193<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231194&lt;directory&gt;
1195</dt>
1196<dd>
1197<p>
1198 The name of a new directory to clone into. The "humanish"
1199 part of the source repository is used if no directory is
Junio C Hamanoc14e6ad2014-10-31 20:25:531200 explicitly given (<code>repo</code> for <code>/path/to/repo.git</code> and <code>foo</code>
1201 for <code>host.xz:foo/.git</code>). Cloning into an existing directory
Junio C Hamano89bdb3b2009-05-10 06:48:141202 is only allowed if the directory is empty.
Junio C Hamano1a4e8412005-12-27 08:17:231203</p>
1204</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311205</dl></div>
Junio C Hamano1bb569e2006-05-05 23:14:251206</div>
Junio C Hamano9d971152012-12-19 00:43:111207</div>
1208<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311209<h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2>
Junio C Hamano330aae62007-07-06 17:01:581210<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591211<div class="paragraph"><p>In general, URLs contain information about the transport protocol, the
Junio C Hamano0c053e82010-04-19 06:46:341212address of the remote server, and the path to the repository.
1213Depending on the transport protocol, some of this information may be
1214absent.</p></div>
Junio C Hamano6631a092012-10-10 22:50:571215<div class="paragraph"><p>Git supports ssh, git, http, and https protocols (in addition, ftp,
Junio C Hamanof85ef632016-02-17 22:31:061216and ftps can be used for fetching, but this is inefficient and
1217deprecated; do not use it).</p></div>
Junio C Hamanoa1952302013-07-01 21:31:181218<div class="paragraph"><p>The native transport (i.e. git:// URL) does no authentication and
1219should be used with caution on unsecured networks.</p></div>
Junio C Hamano6631a092012-10-10 22:50:571220<div class="paragraph"><p>The following syntaxes may be used with them:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591221<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:581222<li>
1223<p>
Junio C Hamano0c053e82010-04-19 06:46:341224ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581225</p>
1226</li>
1227<li>
1228<p>
Junio C Hamanoa3bb6eb2009-02-05 01:26:331229git://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581230</p>
1231</li>
1232<li>
1233<p>
Junio C Hamano0c053e82010-04-19 06:46:341234http&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581235</p>
1236</li>
1237<li>
1238<p>
Junio C Hamano0c053e82010-04-19 06:46:341239ftp&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamanodbb64592007-09-01 11:17:391240</p>
1241</li>
Junio C Hamanoba4b9282008-07-06 05:20:311242</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591243<div class="paragraph"><p>An alternative scp-like syntax may also be used with the ssh protocol:</p></div>
1244<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:581245<li>
1246<p>
Junio C Hamano0c053e82010-04-19 06:46:341247&#91;user@&#93;host.xz:path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581248</p>
1249</li>
Junio C Hamanoba4b9282008-07-06 05:20:311250</ul></div>
Junio C Hamano7e590a12013-06-02 23:46:521251<div class="paragraph"><p>This syntax is only recognized if there are no slashes before the
1252first colon. This helps differentiate a local path that contains a
Junio C Hamanoc14e6ad2014-10-31 20:25:531253colon. For example the local path <code>foo:bar</code> could be specified as an
1254absolute path or <code>./foo:bar</code> to avoid being misinterpreted as an ssh
Junio C Hamano7e590a12013-06-02 23:46:521255url.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591256<div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
1257<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:341258<li>
1259<p>
1260ssh://&#91;user@&#93;host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1261</p>
1262</li>
1263<li>
1264<p>
1265git://host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1266</p>
1267</li>
1268<li>
1269<p>
1270&#91;user@&#93;host.xz:/~&#91;user&#93;/path/to/repo.git/
1271</p>
1272</li>
1273</ul></div>
Junio C Hamano076ffcc2013-02-06 05:13:211274<div class="paragraph"><p>For local repositories, also supported by Git natively, the following
Junio C Hamano0c053e82010-04-19 06:46:341275syntaxes may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591276<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:581277<li>
1278<p>
1279/path/to/repo.git/
1280</p>
1281</li>
Junio C Hamanob1d6e882007-08-11 08:30:161282<li>
1283<p>
Junio C Hamanodc8f8de2013-06-05 22:58:071284file:///path/to/repo.git/
Junio C Hamanob1d6e882007-08-11 08:30:161285</p>
1286</li>
Junio C Hamanoba4b9282008-07-06 05:20:311287</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591288<div class="paragraph"><p>These two syntaxes are mostly equivalent, except the former implies
Junio C Hamano0c053e82010-04-19 06:46:341289--local option.</p></div>
Junio C Hamanob4896852019-12-10 23:15:091290<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
1291accept a suitable bundle file. See <a href="git-bundle.html">git-bundle(1)</a>.</p></div>
Junio C Hamano076ffcc2013-02-06 05:13:211292<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:341293attempts to use the <em>remote-&lt;transport&gt;</em> remote helper, if one
1294exists. To explicitly request a remote helper, the following syntax
1295may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591296<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:341297<li>
1298<p>
1299&lt;transport&gt;::&lt;address&gt;
1300</p>
1301</li>
1302</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591303<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:341304URL-like string recognized by the specific remote helper being
Junio C Hamanob5513772019-04-22 03:38:391305invoked. See <a href="gitremote-helpers.html">gitremote-helpers(7)</a> for details.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591306<div class="paragraph"><p>If there are a large number of similarly-named remote repositories and
Junio C Hamano24bc09a2008-02-28 00:27:441307you want to use a different format for them (such that the URLs you
1308use will be rewritten into URLs that work), you can create a
Junio C Hamanoba4b9282008-07-06 05:20:311309configuration section of the form:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441310<div class="listingblock">
1311<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531312<pre><code> [url "&lt;actual url base&gt;"]
1313 insteadOf = &lt;other url base&gt;</code></pre>
Junio C Hamano24bc09a2008-02-28 00:27:441314</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591315<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441316<div class="listingblock">
1317<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531318<pre><code> [url "git://git.host.xz/"]
Junio C Hamano24bc09a2008-02-28 00:27:441319 insteadOf = host.xz:/path/to/
Junio C Hamanoc14e6ad2014-10-31 20:25:531320 insteadOf = work:</code></pre>
Junio C Hamano24bc09a2008-02-28 00:27:441321</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591322<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:311323rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591324<div class="paragraph"><p>If you want to rewrite URLs for push only, you can create a
Junio C Hamano7df6dcf2009-09-13 09:51:171325configuration section of the form:</p></div>
1326<div class="listingblock">
1327<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531328<pre><code> [url "&lt;actual url base&gt;"]
1329 pushInsteadOf = &lt;other url base&gt;</code></pre>
Junio C Hamano7df6dcf2009-09-13 09:51:171330</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591331<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano7df6dcf2009-09-13 09:51:171332<div class="listingblock">
1333<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531334<pre><code> [url "ssh://example.org/"]
1335 pushInsteadOf = git://example.org/</code></pre>
Junio C Hamano7df6dcf2009-09-13 09:51:171336</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591337<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:171338"ssh://example.org/path/to/repo.git" for pushes, but pulls will still
1339use the original URL.</p></div>
Junio C Hamano330aae62007-07-06 17:01:581340</div>
Junio C Hamano9d971152012-12-19 00:43:111341</div>
1342<div class="sect1">
Junio C Hamanob9d9d902018-05-23 07:07:421343<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1bb569e2006-05-05 23:14:251344<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591345<div class="ulist"><ul>
Junio C Hamano9ccf6642010-03-22 01:47:351346<li>
1347<p>
1348Clone from upstream:
1349</p>
Junio C Hamano1a4e8412005-12-27 08:17:231350<div class="listingblock">
1351<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531352<pre><code>$ git clone git://git.kernel.org/pub/scm/.../linux.git my-linux
Junio C Hamanoa1952302013-07-01 21:31:181353$ cd my-linux
Junio C Hamanoc14e6ad2014-10-31 20:25:531354$ make</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231355</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351356</li>
1357<li>
1358<p>
1359Make a local clone that borrows from the current directory, without checking things out:
1360</p>
Junio C Hamano1a4e8412005-12-27 08:17:231361<div class="listingblock">
1362<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531363<pre><code>$ git clone -l -s -n . ../copy
Junio C Hamano8638c922007-05-12 20:50:081364$ cd ../copy
Junio C Hamanoc14e6ad2014-10-31 20:25:531365$ git show-branch</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231366</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351367</li>
1368<li>
1369<p>
1370Clone from upstream while borrowing from an existing local directory:
1371</p>
Junio C Hamanof50bfec2006-04-19 09:44:121372<div class="listingblock">
1373<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531374<pre><code>$ git clone --reference /git/linux.git \
Junio C Hamanoa1952302013-07-01 21:31:181375 git://git.kernel.org/pub/scm/.../linux.git \
1376 my-linux
Junio C Hamanoc14e6ad2014-10-31 20:25:531377$ cd my-linux</code></pre>
Junio C Hamanof50bfec2006-04-19 09:44:121378</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351379</li>
1380<li>
1381<p>
1382Create a bare repository to publish your changes to the public:
1383</p>
Junio C Hamano38064d52006-01-15 10:13:491384<div class="listingblock">
1385<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531386<pre><code>$ git clone --bare -l /home/proj/.git /pub/scm/proj.git</code></pre>
Junio C Hamano38064d52006-01-15 10:13:491387</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351388</li>
Junio C Hamano9ccf6642010-03-22 01:47:351389</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:231390</div>
Junio C Hamano9d971152012-12-19 00:43:111391</div>
1392<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311393<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231394<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231395<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231396</div>
Junio C Hamano7bd050f2011-09-22 06:32:221397</div>
Junio C Hamano9d971152012-12-19 00:43:111398</div>
Junio C Hamano7bd050f2011-09-22 06:32:221399<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:231400<div id="footer">
1401<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:531402Last updated
Junio C Hamano7a46cd62020-03-15 21:57:101403 2020-03-10 08:03:13 PDT
Junio C Hamano1a4e8412005-12-27 08:17:231404</div>
1405</div>
1406</body>
1407</html>