blob: d3114be7cbf8738f3c0d9c358c94a7880d885bdc [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
Junio C Hamano9d971152012-12-19 00:43:115<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamano61525f92014-01-17 22:46:496<meta name="generator" content="AsciiDoc 8.6.6" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-clone(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:119/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2324}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
Junio C Hamanoba4b9282008-07-06 05:20:3130a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
Junio C Hamano1a4e8412005-12-27 08:17:2337
38em {
39 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5940 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2341}
42
43strong {
44 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5945 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2346}
47
Junio C Hamano1a4e8412005-12-27 08:17:2348h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2350 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
Junio C Hamanoba4b9282008-07-06 05:20:3155h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2356 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2359 padding-top: 0.5em;
60}
Junio C Hamanoba4b9282008-07-06 05:20:3161h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9d971152012-12-19 00:43:1167h5 {
68 font-size: 1.0em;
69}
Junio C Hamano1a4e8412005-12-27 08:17:2370
71div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2372 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
Junio C Hamano68cf15a2010-11-06 01:01:5984ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9d971152012-12-19 00:43:1187ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5989
Junio C Hamano61525f92014-01-17 22:46:4990pre {
Junio C Hamano1a4e8412005-12-27 08:17:2391 padding: 0;
92 margin: 0;
93}
94
Junio C Hamano9d971152012-12-19 00:43:1195#author {
Junio C Hamano1a4e8412005-12-27 08:17:2396 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2397 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3198 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2399}
Junio C Hamano9d971152012-12-19 00:43:11100#email {
Junio C Hamano1a4e8412005-12-27 08:17:23101}
Junio C Hamano9d971152012-12-19 00:43:11102#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23103}
104
Junio C Hamano9d971152012-12-19 00:43:11105#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23106 font-size: small;
107 border-top: 2px solid silver;
108 padding-top: 0.5em;
109 margin-top: 4.0em;
110}
Junio C Hamano9d971152012-12-19 00:43:11111#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23112 float: left;
113 padding-bottom: 0.5em;
114}
Junio C Hamano9d971152012-12-19 00:43:11115#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23116 float: right;
117 padding-bottom: 0.5em;
118}
119
Junio C Hamano9d971152012-12-19 00:43:11120#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
123}
Junio C Hamano9d971152012-12-19 00:43:11124div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23125div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
126div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22127 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23128 margin-bottom: 1.5em;
129}
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 2.0em;
132 margin-bottom: 2.0em;
133 margin-right: 10%;
134 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23135}
136
137div.content { /* Block element content. */
138 padding: 0;
139}
140
141/* Block element titles. */
142div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59143 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23144 font-weight: bold;
145 text-align: left;
146 margin-top: 1.0em;
147 margin-bottom: 0.5em;
148}
149div.title + * {
150 margin-top: 0;
151}
152
153td div.title:first-child {
154 margin-top: 0.0em;
155}
156div.content div.title:first-child {
157 margin-top: 0.0em;
158}
159div.content + div.title {
160 margin-top: 0.0em;
161}
162
163div.sidebarblock > div.content {
164 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11165 border: 1px solid #dddddd;
166 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23167 padding: 0.5em;
168}
169
170div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11171 border: 1px solid #dddddd;
172 border-left: 5px solid #f0f0f0;
173 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23174 padding: 0.5em;
175}
176
Junio C Hamano7bd050f2011-09-22 06:32:22177div.quoteblock, div.verseblock {
178 padding-left: 1.0em;
179 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59180 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11181 border-left: 5px solid #f0f0f0;
182 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23183}
Junio C Hamano7bd050f2011-09-22 06:32:22184
Junio C Hamano68cf15a2010-11-06 01:01:59185div.quoteblock > div.attribution {
186 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23187 text-align: right;
188}
Junio C Hamano68cf15a2010-11-06 01:01:59189
Junio C Hamano9d971152012-12-19 00:43:11190div.verseblock > pre.content {
191 font-family: inherit;
192 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59193}
194div.verseblock > div.attribution {
195 padding-top: 0.75em;
196 text-align: left;
197}
198/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31199div.verseblock + div.attribution {
200 text-align: left;
201}
Junio C Hamano1a4e8412005-12-27 08:17:23202
203div.admonitionblock .icon {
204 vertical-align: top;
205 font-size: 1.1em;
206 font-weight: bold;
207 text-decoration: underline;
208 color: #527bbd;
209 padding-right: 0.5em;
210}
211div.admonitionblock td.content {
212 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22213 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23214}
215
216div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
218 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23219}
220
Junio C Hamano1a4e8412005-12-27 08:17:23221div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23222span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59223a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23224
225dl {
226 margin-top: 0.8em;
227 margin-bottom: 0.8em;
228}
229dt {
230 margin-top: 0.5em;
231 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59232 font-style: normal;
233 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23234}
235dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59236 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23237}
238
239ul, ol {
240 list-style-position: outside;
241}
Junio C Hamano68cf15a2010-11-06 01:01:59242ol.arabic {
243 list-style-type: decimal;
244}
245ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23246 list-style-type: lower-alpha;
247}
Junio C Hamano68cf15a2010-11-06 01:01:59248ol.upperalpha {
249 list-style-type: upper-alpha;
250}
251ol.lowerroman {
252 list-style-type: lower-roman;
253}
254ol.upperroman {
255 list-style-type: upper-roman;
256}
257
258div.compact ul, div.compact ol,
259div.compact p, div.compact p,
260div.compact div, div.compact div {
261 margin-top: 0.1em;
262 margin-bottom: 0.1em;
263}
Junio C Hamano1a4e8412005-12-27 08:17:23264
Junio C Hamano1a4e8412005-12-27 08:17:23265tfoot {
266 font-weight: bold;
267}
Junio C Hamano68cf15a2010-11-06 01:01:59268td > div.verse {
269 white-space: pre;
270}
Junio C Hamano68cf15a2010-11-06 01:01:59271
272div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23273 margin-top: 0.8em;
274 margin-bottom: 0.8em;
275}
Junio C Hamano68cf15a2010-11-06 01:01:59276div.hdlist tr {
277 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31278}
Junio C Hamano68cf15a2010-11-06 01:01:59279dt.hdlist1.strong, td.hdlist1.strong {
280 font-weight: bold;
281}
282td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23283 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59284 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23285 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59286 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23287}
Junio C Hamano68cf15a2010-11-06 01:01:59288td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23289 vertical-align: top;
290}
Junio C Hamano68cf15a2010-11-06 01:01:59291div.hdlist.compact tr {
292 margin: 0;
293 padding-bottom: 0;
294}
295
296.comment {
297 background: yellow;
298}
Junio C Hamano1a4e8412005-12-27 08:17:23299
Junio C Hamano7bd050f2011-09-22 06:32:22300.footnote, .footnoteref {
301 font-size: 0.8em;
302}
303
304span.footnote, span.footnoteref {
305 vertical-align: super;
306}
307
308#footnotes {
309 margin: 20px 0 20px 0;
310 padding: 7px 0 0 0;
311}
312
313#footnotes div.footnote {
314 margin: 0 0 5px 0;
315}
316
317#footnotes hr {
318 border: none;
319 border-top: 1px solid silver;
320 height: 1px;
321 text-align: left;
322 margin-left: 0;
323 width: 20%;
324 min-width: 100px;
325}
326
Junio C Hamano9d971152012-12-19 00:43:11327div.colist td {
328 padding-right: 0.5em;
329 padding-bottom: 0.3em;
330 vertical-align: top;
331}
332div.colist td img {
333 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23334}
Junio C Hamanoba4b9282008-07-06 05:20:31335
Junio C Hamano9d971152012-12-19 00:43:11336@media print {
337 #footer-badges { display: none; }
338}
339
340#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22341 margin-bottom: 2.5em;
342}
343
Junio C Hamano9d971152012-12-19 00:43:11344#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31345 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31346 font-size: 1.1em;
347 font-weight: bold;
348 margin-top: 1.0em;
349 margin-bottom: 0.1em;
350}
351
Junio C Hamano61525f92014-01-17 22:46:49352div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31353 margin-top: 0;
354 margin-bottom: 0;
355}
356div.toclevel2 {
357 margin-left: 2em;
358 font-size: 0.9em;
359}
360div.toclevel3 {
361 margin-left: 4em;
362 font-size: 0.9em;
363}
364div.toclevel4 {
365 margin-left: 6em;
366 font-size: 0.9em;
367}
Junio C Hamano9d971152012-12-19 00:43:11368
369span.aqua { color: aqua; }
370span.black { color: black; }
371span.blue { color: blue; }
372span.fuchsia { color: fuchsia; }
373span.gray { color: gray; }
374span.green { color: green; }
375span.lime { color: lime; }
376span.maroon { color: maroon; }
377span.navy { color: navy; }
378span.olive { color: olive; }
379span.purple { color: purple; }
380span.red { color: red; }
381span.silver { color: silver; }
382span.teal { color: teal; }
383span.white { color: white; }
384span.yellow { color: yellow; }
385
386span.aqua-background { background: aqua; }
387span.black-background { background: black; }
388span.blue-background { background: blue; }
389span.fuchsia-background { background: fuchsia; }
390span.gray-background { background: gray; }
391span.green-background { background: green; }
392span.lime-background { background: lime; }
393span.maroon-background { background: maroon; }
394span.navy-background { background: navy; }
395span.olive-background { background: olive; }
396span.purple-background { background: purple; }
397span.red-background { background: red; }
398span.silver-background { background: silver; }
399span.teal-background { background: teal; }
400span.white-background { background: white; }
401span.yellow-background { background: yellow; }
402
403span.big { font-size: 2em; }
404span.small { font-size: 0.6em; }
405
406span.underline { text-decoration: underline; }
407span.overline { text-decoration: overline; }
408span.line-through { text-decoration: line-through; }
409
Junio C Hamano9d971152012-12-19 00:43:11410
411/*
412 * xhtml11 specific
413 *
414 * */
415
Junio C Hamano61525f92014-01-17 22:46:49416tt {
417 font-family: monospace;
418 font-size: inherit;
419 color: navy;
420}
421
Junio C Hamano9d971152012-12-19 00:43:11422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
425}
426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
430 font-weight: bold;
431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
447}
448
449
450/*
451 * html5 specific
452 *
453 * */
454
Junio C Hamano61525f92014-01-17 22:46:49455.monospaced {
456 font-family: monospace;
457 font-size: inherit;
458 color: navy;
459}
460
Junio C Hamano9d971152012-12-19 00:43:11461table.tableblock {
462 margin-top: 1.0em;
463 margin-bottom: 1.5em;
464}
465thead, p.tableblock.header {
466 font-weight: bold;
467 color: #527bbd;
468}
469p.tableblock {
470 margin-top: 0;
471}
472table.tableblock {
473 border-width: 3px;
474 border-spacing: 0px;
475 border-style: solid;
476 border-color: #527bbd;
477 border-collapse: collapse;
478}
479th.tableblock, td.tableblock {
480 border-width: 1px;
481 padding: 4px;
482 border-style: solid;
483 border-color: #527bbd;
484}
485
486table.tableblock.frame-topbot {
487 border-left-style: hidden;
488 border-right-style: hidden;
489}
490table.tableblock.frame-sides {
491 border-top-style: hidden;
492 border-bottom-style: hidden;
493}
494table.tableblock.frame-none {
495 border-style: hidden;
496}
497
498th.tableblock.halign-left, td.tableblock.halign-left {
499 text-align: left;
500}
501th.tableblock.halign-center, td.tableblock.halign-center {
502 text-align: center;
503}
504th.tableblock.halign-right, td.tableblock.halign-right {
505 text-align: right;
506}
507
508th.tableblock.valign-top, td.tableblock.valign-top {
509 vertical-align: top;
510}
511th.tableblock.valign-middle, td.tableblock.valign-middle {
512 vertical-align: middle;
513}
514th.tableblock.valign-bottom, td.tableblock.valign-bottom {
515 vertical-align: bottom;
516}
517
518
519/*
520 * manpage specific
521 *
522 * */
523
524body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59525 padding-top: 0.5em;
526 padding-bottom: 0.5em;
527 border-top: 2px solid silver;
528 border-bottom: 2px solid silver;
529}
Junio C Hamano9d971152012-12-19 00:43:11530body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59531 border-style: none;
532}
Junio C Hamano9d971152012-12-19 00:43:11533body.manpage div.sectionbody {
534 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59535}
536
537@media print {
Junio C Hamano9d971152012-12-19 00:43:11538 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59539}
Junio C Hamano1a4e8412005-12-27 08:17:23540</style>
Junio C Hamano7bd050f2011-09-22 06:32:22541<script type="text/javascript">
542/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22543var asciidoc = { // Namespace.
544
545/////////////////////////////////////////////////////////////////////
546// Table Of Contents generator
547/////////////////////////////////////////////////////////////////////
548
549/* Author: Mihai Bazon, September 2002
550 * http://students.infoiasi.ro/~mishoo
551 *
552 * Table Of Content generator
553 * Version: 0.4
554 *
555 * Feel free to use this script under the terms of the GNU General Public
556 * License, as long as you do not remove or alter this notice.
557 */
558
559 /* modified by Troy D. Hanson, September 2006. License: GPL */
560 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
561
562// toclevels = 1..4.
563toc: function (toclevels) {
564
565 function getText(el) {
566 var text = "";
567 for (var i = el.firstChild; i != null; i = i.nextSibling) {
568 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 text += i.data;
570 else if (i.firstChild != null)
571 text += getText(i);
572 }
573 return text;
574 }
575
576 function TocEntry(el, text, toclevel) {
577 this.element = el;
578 this.text = text;
579 this.toclevel = toclevel;
580 }
581
582 function tocEntries(el, toclevels) {
583 var result = new Array;
Junio C Hamano61525f92014-01-17 22:46:49584 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22585 // Function that scans the DOM tree for header elements (the DOM2
586 // nodeIterator API would be a better technique but not supported by all
587 // browsers).
588 var iterate = function (el) {
589 for (var i = el.firstChild; i != null; i = i.nextSibling) {
590 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
591 var mo = re.exec(i.tagName);
592 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
593 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
594 }
595 iterate(i);
596 }
597 }
598 }
599 iterate(el);
600 return result;
601 }
602
603 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11604 if (!toc) {
605 return;
606 }
607
608 // Delete existing TOC entries in case we're reloading the TOC.
609 var tocEntriesToRemove = [];
610 var i;
611 for (i = 0; i < toc.childNodes.length; i++) {
612 var entry = toc.childNodes[i];
Junio C Hamano61525f92014-01-17 22:46:49613 if (entry.nodeName == 'div'
Junio C Hamano9d971152012-12-19 00:43:11614 && entry.getAttribute("class")
615 && entry.getAttribute("class").match(/^toclevel/))
616 tocEntriesToRemove.push(entry);
617 }
618 for (i = 0; i < tocEntriesToRemove.length; i++) {
619 toc.removeChild(tocEntriesToRemove[i]);
620 }
621
622 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22623 var entries = tocEntries(document.getElementById("content"), toclevels);
624 for (var i = 0; i < entries.length; ++i) {
625 var entry = entries[i];
626 if (entry.element.id == "")
627 entry.element.id = "_toc_" + i;
628 var a = document.createElement("a");
629 a.href = "#" + entry.element.id;
630 a.appendChild(document.createTextNode(entry.text));
631 var div = document.createElement("div");
632 div.appendChild(a);
633 div.className = "toclevel" + entry.toclevel;
634 toc.appendChild(div);
635 }
636 if (entries.length == 0)
637 toc.parentNode.removeChild(toc);
638},
639
640
641/////////////////////////////////////////////////////////////////////
642// Footnotes generator
643/////////////////////////////////////////////////////////////////////
644
645/* Based on footnote generation code from:
646 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
647 */
648
649footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11650 // Delete existing footnote entries in case we're reloading the footnodes.
651 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22652 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11653 if (!noteholder) {
654 return;
655 }
656 var entriesToRemove = [];
657 for (i = 0; i < noteholder.childNodes.length; i++) {
658 var entry = noteholder.childNodes[i];
Junio C Hamano61525f92014-01-17 22:46:49659 if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9d971152012-12-19 00:43:11660 entriesToRemove.push(entry);
661 }
662 for (i = 0; i < entriesToRemove.length; i++) {
663 noteholder.removeChild(entriesToRemove[i]);
664 }
665
666 // Rebuild footnote entries.
667 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22668 var spans = cont.getElementsByTagName("span");
669 var refs = {};
670 var n = 0;
671 for (i=0; i<spans.length; i++) {
672 if (spans[i].className == "footnote") {
673 n++;
Junio C Hamano9d971152012-12-19 00:43:11674 var note = spans[i].getAttribute("data-note");
675 if (!note) {
676 // Use [\s\S] in place of . so multi-line matches work.
677 // Because JavaScript has no s (dotall) regex flag.
678 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
679 spans[i].innerHTML =
680 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
681 "' title='View footnote' class='footnote'>" + n + "</a>]";
682 spans[i].setAttribute("data-note", note);
683 }
Junio C Hamano7bd050f2011-09-22 06:32:22684 noteholder.innerHTML +=
685 "<div class='footnote' id='_footnote_" + n + "'>" +
686 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
687 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22688 var id =spans[i].getAttribute("id");
689 if (id != null) refs["#"+id] = n;
690 }
691 }
692 if (n == 0)
693 noteholder.parentNode.removeChild(noteholder);
694 else {
695 // Process footnoterefs.
696 for (i=0; i<spans.length; i++) {
697 if (spans[i].className == "footnoteref") {
698 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
699 href = href.match(/#.*/)[0]; // Because IE return full URL.
700 n = refs[href];
701 spans[i].innerHTML =
702 "[<a href='#_footnote_" + n +
703 "' title='View footnote' class='footnote'>" + n + "</a>]";
704 }
705 }
706 }
Junio C Hamano9d971152012-12-19 00:43:11707},
708
709install: function(toclevels) {
710 var timerId;
711
712 function reinstall() {
713 asciidoc.footnotes();
714 if (toclevels) {
715 asciidoc.toc(toclevels);
716 }
717 }
718
719 function reinstallAndRemoveTimer() {
720 clearInterval(timerId);
721 reinstall();
722 }
723
724 timerId = setInterval(reinstall, 500);
725 if (document.addEventListener)
726 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
727 else
728 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22729}
730
731}
Junio C Hamano9d971152012-12-19 00:43:11732asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22733/*]]>*/
734</script>
Junio C Hamano1a4e8412005-12-27 08:17:23735</head>
Junio C Hamano9d971152012-12-19 00:43:11736<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23737<div id="header">
738<h1>
739git-clone(1) Manual Page
740</h1>
741<h2>NAME</h2>
742<div class="sectionbody">
743<p>git-clone -
Junio C Hamano4ec06712007-06-09 20:39:33744 Clone a repository into a new directory
Junio C Hamano1a4e8412005-12-27 08:17:23745</p>
746</div>
747</div>
Junio C Hamano7bd050f2011-09-22 06:32:22748<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11749<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59750<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23751<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58752<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11753<pre class="content"><em>git clone</em> [--template=&lt;template_directory&gt;]
Junio C Hamanoaf1987f2008-08-03 07:58:19754 [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
Junio C Hamano2bd8a742009-12-01 21:16:59755 [-o &lt;name&gt;] [-b &lt;name&gt;] [-u &lt;upload-pack&gt;] [--reference &lt;repository&gt;]
Junio C Hamanof93530e2011-05-25 23:59:59756 [--separate-git-dir &lt;git dir&gt;]
Junio C Hamanob5be0522012-01-29 22:20:19757 [--depth &lt;depth&gt;] [--[no-]single-branch]
Junio C Hamano3d1b5a12013-05-17 23:34:02758 [--recursive | --recurse-submodules] [--] &lt;repository&gt;
Junio C Hamano9d971152012-12-19 00:43:11759 [&lt;directory&gt;]</pre>
760<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 Hamano61525f92014-01-17 22:46:49769(visible using <tt>git branch -r</tt>), 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 Hamano61525f92014-01-17 22:46:49772<div class="paragraph"><p>After the clone, a plain <tt>git fetch</tt> without arguments will update
773all the remote-tracking branches, and a <tt>git pull</tt> 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 Hamano61525f92014-01-17 22:46:49778the remote branch heads under <tt>refs/remotes/origin</tt> and
779by initializing <tt>remote.origin.url</tt> and <tt>remote.origin.fetch</tt>
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 Hamano1a4e8412005-12-27 08:17:23788--local
789</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59790<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23791-l
792</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 Hamano61525f92014-01-17 22:46:49799 The files under <tt>.git/objects/</tt> 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 Hamano61525f92014-01-17 22:46:49802<div class="paragraph"><p>If the repository is specified as a local path (e.g., <tt>/path/to/repo</tt>),
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 Hamano61525f92014-01-17 22:46:49805never use the local optimizations). Specifying <tt>--no-local</tt> will
806override the default when <tt>/path/to/repo</tt> is given, using the regular
Junio C Hamano076ffcc2013-02-06 05:13:21807Git transport instead.</p></div>
Junio C Hamano7f2b3cb2012-06-22 22:42:39808<div class="paragraph"><p>To force copying instead of hardlinking (which may be desirable if you
809are trying to make a back-up of your repository), but still avoid the
Junio C Hamano61525f92014-01-17 22:46:49810usual "Git aware" transport mechanism, <tt>--no-hardlinks</tt> can be used.</p></div>
Junio C Hamanob1d6e882007-08-11 08:30:16811</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59812<dt class="hdlist1">
Junio C Hamanob1d6e882007-08-11 08:30:16813--no-hardlinks
814</dt>
815<dd>
816<p>
817 Optimize the cloning process from a repository on a
Junio C Hamano61525f92014-01-17 22:46:49818 local filesystem by copying files under <tt>.git/objects</tt>
Junio C Hamanob1d6e882007-08-11 08:30:16819 directory.
Junio C Hamano1a4e8412005-12-27 08:17:23820</p>
821</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59822<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23823--shared
824</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59825<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23826-s
827</dt>
828<dd>
829<p>
830 When the repository to clone is on the local machine,
831 instead of using hard links, automatically setup
Junio C Hamano61525f92014-01-17 22:46:49832 <tt>.git/objects/info/alternates</tt> to share the objects
Junio C Hamano1a4e8412005-12-27 08:17:23833 with the source repository. The resulting repository
834 starts out without any object of its own.
835</p>
Junio C Hamano68cf15a2010-11-06 01:01:59836<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:31837it unless you understand what it does. If you clone your
Junio C Hamanoa9aee782008-04-23 16:09:20838repository using this option and then delete branches (or use any
Junio C Hamano076ffcc2013-02-06 05:13:21839other Git command that makes any existing commit unreferenced) in the
Junio C Hamanoa9aee782008-04-23 16:09:20840source repository, some objects may become unreferenced (or dangling).
Junio C Hamano61525f92014-01-17 22:46:49841These objects may be removed by normal Git operations (such as <tt>git commit</tt>)
842which automatically call <tt>git gc --auto</tt>. (See <a href="git-gc.html">git-gc(1)</a>.)
Junio C Hamanofce7c7e2008-07-02 03:06:38843If these objects are removed and were referenced by the cloned repository,
Junio C Hamanoba4b9282008-07-06 05:20:31844then the cloned repository will become corrupt.</p></div>
Junio C Hamano61525f92014-01-17 22:46:49845<div class="paragraph"><p>Note that running <tt>git repack</tt> without the <tt>-l</tt> option in a repository
846cloned with <tt>-s</tt> will copy objects from the source repository into a pack
847in the cloned repository, removing the disk space savings of <tt>clone -s</tt>.
848It is safe, however, to run <tt>git gc</tt>, which uses the <tt>-l</tt> option by
Junio C Hamanob9376922009-08-19 00:09:13849default.</p></div>
Junio C Hamano61525f92014-01-17 22:46:49850<div class="paragraph"><p>If you want to break the dependency of a repository cloned with <tt>-s</tt> on
851its source repository, you can simply run <tt>git repack -a</tt> to copy all
Junio C Hamanob9376922009-08-19 00:09:13852objects from the source repository into a pack in the cloned repository.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23853</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59854<dt class="hdlist1">
Junio C Hamanof50bfec2006-04-19 09:44:12855--reference &lt;repository&gt;
856</dt>
857<dd>
858<p>
Junio C Hamano35b47ca2009-09-03 18:11:54859 If the reference repository is on the local machine,
Junio C Hamano61525f92014-01-17 22:46:49860 automatically setup <tt>.git/objects/info/alternates</tt> to
Junio C Hamanof50bfec2006-04-19 09:44:12861 obtain objects from the reference repository. Using
862 an already existing repository as an alternate will
Junio C Hamano250f03e2007-09-10 01:33:28863 require fewer objects to be copied from the repository
Junio C Hamanof50bfec2006-04-19 09:44:12864 being cloned, reducing network and local storage costs.
865</p>
Junio C Hamano61525f92014-01-17 22:46:49866<div class="paragraph"><p><strong>NOTE</strong>: see the NOTE for the <tt>--shared</tt> option.</p></div>
Junio C Hamanof50bfec2006-04-19 09:44:12867</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59868<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23869--quiet
870</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59871<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23872-q
873</dt>
874<dd>
875<p>
Junio C Hamano6ce6b6c2010-01-18 01:25:50876 Operate quietly. Progress is not reported to the standard
Junio C Hamano68cf15a2010-11-06 01:01:59877 error stream. This flag is also passed to the &#8216;rsync&#8217;
Junio C Hamano3db8b412008-07-26 06:45:59878 command when given.
Junio C Hamano1a4e8412005-12-27 08:17:23879</p>
880</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59881<dt class="hdlist1">
Junio C Hamano7d06a8a2008-10-20 05:42:33882--verbose
883</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59884<dt class="hdlist1">
Junio C Hamano7d06a8a2008-10-20 05:42:33885-v
886</dt>
887<dd>
888<p>
Junio C Hamanoea90ab32010-03-15 20:32:55889 Run verbosely. Does not affect the reporting of progress status
890 to the standard error stream.
Junio C Hamano6ce6b6c2010-01-18 01:25:50891</p>
892</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59893<dt class="hdlist1">
Junio C Hamano6ce6b6c2010-01-18 01:25:50894--progress
895</dt>
896<dd>
897<p>
898 Progress status is reported on the standard error stream
899 by default when it is attached to a terminal, unless -q
900 is specified. This flag forces progress status even if the
901 standard error stream is not directed to a terminal.
Junio C Hamano7d06a8a2008-10-20 05:42:33902</p>
903</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59904<dt class="hdlist1">
Junio C Hamano1e6e0062007-07-13 05:33:25905--no-checkout
906</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59907<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23908-n
909</dt>
910<dd>
911<p>
912 No checkout of HEAD is performed after the clone is complete.
913</p>
914</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59915<dt class="hdlist1">
Junio C Hamanoe663a7a2006-01-25 12:37:28916--bare
Junio C Hamano38064d52006-01-15 10:13:49917</dt>
918<dd>
919<p>
Junio C Hamano076ffcc2013-02-06 05:13:21920 Make a <em>bare</em> Git repository. That is, instead of
Junio C Hamano61525f92014-01-17 22:46:49921 creating <tt>&lt;directory&gt;</tt> and placing the administrative
922 files in <tt>&lt;directory&gt;/.git</tt>, make the <tt>&lt;directory&gt;</tt>
923 itself the <tt>$GIT_DIR</tt>. This obviously implies the <tt>-n</tt>
Junio C Hamano9f292e72006-11-24 11:37:29924 because there is nowhere to check out the working tree.
925 Also the branch heads at the remote are copied directly
926 to corresponding local branch heads, without mapping
Junio C Hamano61525f92014-01-17 22:46:49927 them to <tt>refs/remotes/origin/</tt>. When this option is
Junio C Hamanod3361ad2007-01-01 03:20:24928 used, neither remote-tracking branches nor the related
929 configuration variables are created.
Junio C Hamano38064d52006-01-15 10:13:49930</p>
931</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59932<dt class="hdlist1">
Junio C Hamanoaf1987f2008-08-03 07:58:19933--mirror
934</dt>
935<dd>
936<p>
Junio C Hamano61525f92014-01-17 22:46:49937 Set up a mirror of the source repository. This implies <tt>--bare</tt>.
938 Compared to <tt>--bare</tt>, <tt>--mirror</tt> not only maps local branches of the
Junio C Hamano657fd8a2010-10-07 00:01:24939 source to local branches of the target, it maps all refs (including
Junio C Hamano97bcb482010-11-25 03:16:07940 remote-tracking branches, notes etc.) and sets up a refspec configuration such
Junio C Hamano61525f92014-01-17 22:46:49941 that all these refs are overwritten by a <tt>git remote update</tt> in the
Junio C Hamano657fd8a2010-10-07 00:01:24942 target repository.
Junio C Hamanoaf1987f2008-08-03 07:58:19943</p>
944</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59945<dt class="hdlist1">
Junio C Hamanodcc22ee2006-11-03 02:40:13946--origin &lt;name&gt;
947</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59948<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23949-o &lt;name&gt;
950</dt>
951<dd>
952<p>
Junio C Hamano61525f92014-01-17 22:46:49953 Instead of using the remote name <tt>origin</tt> to keep track
954 of the upstream repository, use <tt>&lt;name&gt;</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:23955</p>
956</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59957<dt class="hdlist1">
Junio C Hamanoc28068f2009-09-08 00:55:23958--branch &lt;name&gt;
959</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59960<dt class="hdlist1">
Junio C Hamanoc28068f2009-09-08 00:55:23961-b &lt;name&gt;
962</dt>
963<dd>
964<p>
965 Instead of pointing the newly created HEAD to the branch pointed
Junio C Hamano61525f92014-01-17 22:46:49966 to by the cloned repository&#8217;s HEAD, point to <tt>&lt;name&gt;</tt> branch
Junio C Hamano6a8a8482012-10-01 20:59:41967 instead. In a non-bare repository, this is the branch that will
968 be checked out.
Junio C Hamano61525f92014-01-17 22:46:49969 <tt>--branch</tt> can also take tags and detaches the HEAD at that commit
Junio C Hamano6a8a8482012-10-01 20:59:41970 in the resulting repository.
Junio C Hamanoc28068f2009-09-08 00:55:23971</p>
972</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59973<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23974--upload-pack &lt;upload-pack&gt;
975</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59976<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23977-u &lt;upload-pack&gt;
978</dt>
979<dd>
980<p>
Junio C Hamano3db8b412008-07-26 06:45:59981 When given, and the repository to clone from is accessed
982 via ssh, this specifies a non-default path for the command
Junio C Hamano1a4e8412005-12-27 08:17:23983 run on the other end.
984</p>
985</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59986<dt class="hdlist1">
Junio C Hamanof31d9f52006-05-28 20:58:09987--template=&lt;template_directory&gt;
988</dt>
989<dd>
990<p>
991 Specify the directory from which templates will be used;
Junio C Hamanoa28a9202012-06-21 07:08:23992 (See the "TEMPLATE DIRECTORY" section of <a href="git-init.html">git-init(1)</a>.)
Junio C Hamanof31d9f52006-05-28 20:58:09993</p>
994</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59995<dt class="hdlist1">
Junio C Hamano708376e2011-07-19 20:02:13996--config &lt;key&gt;=&lt;value&gt;
997</dt>
998<dt class="hdlist1">
999-c &lt;key&gt;=&lt;value&gt;
1000</dt>
1001<dd>
1002<p>
1003 Set a configuration variable in the newly-created repository;
1004 this takes effect immediately after the repository is
1005 initialized, but before the remote history is fetched or any
1006 files checked out. The key is in the same format as expected by
Junio C Hamano61525f92014-01-17 22:46:491007 <a href="git-config.html">git-config(1)</a> (e.g., <tt>core.eol=true</tt>). If multiple
Junio C Hamano708376e2011-07-19 20:02:131008 values are given for the same key, each value will be written to
1009 the config file. This makes it safe, for example, to add
1010 additional fetch refspecs to the origin remote.
1011</p>
1012</dd>
1013<dt class="hdlist1">
Junio C Hamano0bbd4672007-02-20 04:52:141014--depth &lt;depth&gt;
Junio C Hamanob288d9e2007-01-02 00:04:151015</dt>
1016<dd>
1017<p>
1018 Create a <em>shallow</em> clone with a history truncated to the
Junio C Hamano61525f92014-01-17 22:46:491019 specified number of revisions.
Junio C Hamanob288d9e2007-01-02 00:04:151020</p>
1021</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591022<dt class="hdlist1">
Junio C Hamano3d1b5a12013-05-17 23:34:021023--[no-]single-branch
Junio C Hamanob5be0522012-01-29 22:20:191024</dt>
1025<dd>
1026<p>
1027 Clone only the history leading to the tip of a single branch,
Junio C Hamano61525f92014-01-17 22:46:491028 either specified by the <tt>--branch</tt> option or the primary
1029 branch remote&#8217;s <tt>HEAD</tt> points at. When creating a shallow
1030 clone with the <tt>--depth</tt> option, this is the default, unless
1031 <tt>--no-single-branch</tt> is given to fetch the histories near the
Junio C Hamanob5be0522012-01-29 22:20:191032 tips of all branches.
Junio C Hamano6a8a8482012-10-01 20:59:411033 Further fetches into the resulting repository will only update the
Junio C Hamanoa1295452012-11-13 22:32:041034 remote-tracking branch for the branch this option was used for the
Junio C Hamano6a8a8482012-10-01 20:59:411035 initial cloning. If the HEAD at the remote did not point at any
Junio C Hamano61525f92014-01-17 22:46:491036 branch when <tt>--single-branch</tt> clone was made, no remote-tracking
Junio C Hamano6a8a8482012-10-01 20:59:411037 branch is created.
Junio C Hamanob5be0522012-01-29 22:20:191038</p>
1039</dd>
1040<dt class="hdlist1">
Junio C Hamano0e066b92009-08-28 01:08:411041--recursive
1042</dt>
Junio C Hamanoed69a742010-12-01 03:09:231043<dt class="hdlist1">
1044--recurse-submodules
1045</dt>
Junio C Hamano0e066b92009-08-28 01:08:411046<dd>
1047<p>
1048 After the clone is created, initialize all submodules within,
1049 using their default settings. This is equivalent to running
Junio C Hamano61525f92014-01-17 22:46:491050 <tt>git submodule update --init --recursive</tt> immediately after
Junio C Hamano0e066b92009-08-28 01:08:411051 the clone is finished. This option is ignored if the cloned
1052 repository does not have a worktree/checkout (i.e. if any of
Junio C Hamano61525f92014-01-17 22:46:491053 <tt>--no-checkout</tt>/<tt>-n</tt>, <tt>--bare</tt>, or <tt>--mirror</tt> is given)
Junio C Hamano0e066b92009-08-28 01:08:411054</p>
1055</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591056<dt class="hdlist1">
Junio C Hamanoa03ac862011-04-02 04:32:291057--separate-git-dir=&lt;git dir&gt;
1058</dt>
1059<dd>
1060<p>
1061 Instead of placing the cloned repository where it is supposed
1062 to be, place the cloned repository at the specified directory,
Junio C Hamano076ffcc2013-02-06 05:13:211063 then make a filesytem-agnostic Git symbolic link to there.
1064 The result is Git repository can be separated from working
Junio C Hamanoa03ac862011-04-02 04:32:291065 tree.
1066</p>
1067</dd>
1068<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231069&lt;repository&gt;
1070</dt>
1071<dd>
1072<p>
Junio C Hamano330aae62007-07-06 17:01:581073 The (possibly remote) repository to clone from. See the
1074 <a href="#URLS">URLS</a> section below for more information on specifying
1075 repositories.
Junio C Hamano1a4e8412005-12-27 08:17:231076</p>
1077</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591078<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231079&lt;directory&gt;
1080</dt>
1081<dd>
1082<p>
1083 The name of a new directory to clone into. The "humanish"
1084 part of the source repository is used if no directory is
Junio C Hamano61525f92014-01-17 22:46:491085 explicitly given (<tt>repo</tt> for <tt>/path/to/repo.git</tt> and <tt>foo</tt>
1086 for <tt>host.xz:foo/.git</tt>). Cloning into an existing directory
Junio C Hamano89bdb3b2009-05-10 06:48:141087 is only allowed if the directory is empty.
Junio C Hamano1a4e8412005-12-27 08:17:231088</p>
1089</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311090</dl></div>
Junio C Hamano1bb569e2006-05-05 23:14:251091</div>
Junio C Hamano9d971152012-12-19 00:43:111092</div>
1093<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311094<h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2>
Junio C Hamano330aae62007-07-06 17:01:581095<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591096<div class="paragraph"><p>In general, URLs contain information about the transport protocol, the
Junio C Hamano0c053e82010-04-19 06:46:341097address of the remote server, and the path to the repository.
1098Depending on the transport protocol, some of this information may be
1099absent.</p></div>
Junio C Hamano6631a092012-10-10 22:50:571100<div class="paragraph"><p>Git supports ssh, git, http, and https protocols (in addition, ftp,
1101and ftps can be used for fetching and rsync can be used for fetching
1102and pushing, but these are inefficient and deprecated; do not use
1103them).</p></div>
Junio C Hamanoa1952302013-07-01 21:31:181104<div class="paragraph"><p>The native transport (i.e. git:// URL) does no authentication and
1105should be used with caution on unsecured networks.</p></div>
Junio C Hamano6631a092012-10-10 22:50:571106<div class="paragraph"><p>The following syntaxes may be used with them:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591107<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:581108<li>
1109<p>
Junio C Hamano0c053e82010-04-19 06:46:341110ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581111</p>
1112</li>
1113<li>
1114<p>
Junio C Hamanoa3bb6eb2009-02-05 01:26:331115git://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581116</p>
1117</li>
1118<li>
1119<p>
Junio C Hamano0c053e82010-04-19 06:46:341120http&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581121</p>
1122</li>
1123<li>
1124<p>
Junio C Hamano0c053e82010-04-19 06:46:341125ftp&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamanodbb64592007-09-01 11:17:391126</p>
1127</li>
1128<li>
1129<p>
Junio C Hamano0c053e82010-04-19 06:46:341130rsync://host.xz/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581131</p>
1132</li>
Junio C Hamanoba4b9282008-07-06 05:20:311133</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591134<div class="paragraph"><p>An alternative scp-like syntax may also be used with the ssh protocol:</p></div>
1135<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:581136<li>
1137<p>
Junio C Hamano0c053e82010-04-19 06:46:341138&#91;user@&#93;host.xz:path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581139</p>
1140</li>
Junio C Hamanoba4b9282008-07-06 05:20:311141</ul></div>
Junio C Hamano7e590a12013-06-02 23:46:521142<div class="paragraph"><p>This syntax is only recognized if there are no slashes before the
1143first colon. This helps differentiate a local path that contains a
Junio C Hamano61525f92014-01-17 22:46:491144colon. For example the local path <tt>foo:bar</tt> could be specified as an
1145absolute path or <tt>./foo:bar</tt> to avoid being misinterpreted as an ssh
Junio C Hamano7e590a12013-06-02 23:46:521146url.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591147<div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
1148<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:341149<li>
1150<p>
1151ssh://&#91;user@&#93;host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1152</p>
1153</li>
1154<li>
1155<p>
1156git://host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1157</p>
1158</li>
1159<li>
1160<p>
1161&#91;user@&#93;host.xz:/~&#91;user&#93;/path/to/repo.git/
1162</p>
1163</li>
1164</ul></div>
Junio C Hamano076ffcc2013-02-06 05:13:211165<div class="paragraph"><p>For local repositories, also supported by Git natively, the following
Junio C Hamano0c053e82010-04-19 06:46:341166syntaxes may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591167<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:581168<li>
1169<p>
1170/path/to/repo.git/
1171</p>
1172</li>
Junio C Hamanob1d6e882007-08-11 08:30:161173<li>
1174<p>
Junio C Hamanodc8f8de2013-06-05 22:58:071175file:///path/to/repo.git/
Junio C Hamanob1d6e882007-08-11 08:30:161176</p>
1177</li>
Junio C Hamanoba4b9282008-07-06 05:20:311178</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591179<div class="paragraph"><p>These two syntaxes are mostly equivalent, except the former implies
Junio C Hamano0c053e82010-04-19 06:46:341180--local option.</p></div>
Junio C Hamano076ffcc2013-02-06 05:13:211181<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:341182attempts to use the <em>remote-&lt;transport&gt;</em> remote helper, if one
1183exists. To explicitly request a remote helper, the following syntax
1184may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591185<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:341186<li>
1187<p>
1188&lt;transport&gt;::&lt;address&gt;
1189</p>
1190</li>
1191</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591192<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:341193URL-like string recognized by the specific remote helper being
Junio C Hamanob5e079f2013-02-08 00:02:521194invoked. See <a href="gitremote-helpers.html">gitremote-helpers(1)</a> for details.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591195<div class="paragraph"><p>If there are a large number of similarly-named remote repositories and
Junio C Hamano24bc09a2008-02-28 00:27:441196you want to use a different format for them (such that the URLs you
1197use will be rewritten into URLs that work), you can create a
Junio C Hamanoba4b9282008-07-06 05:20:311198configuration section of the form:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441199<div class="listingblock">
1200<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491201<pre><tt> [url "&lt;actual url base&gt;"]
1202 insteadOf = &lt;other url base&gt;</tt></pre>
Junio C Hamano24bc09a2008-02-28 00:27:441203</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591204<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441205<div class="listingblock">
1206<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491207<pre><tt> [url "git://git.host.xz/"]
Junio C Hamano24bc09a2008-02-28 00:27:441208 insteadOf = host.xz:/path/to/
Junio C Hamano61525f92014-01-17 22:46:491209 insteadOf = work:</tt></pre>
Junio C Hamano24bc09a2008-02-28 00:27:441210</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591211<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:311212rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591213<div class="paragraph"><p>If you want to rewrite URLs for push only, you can create a
Junio C Hamano7df6dcf2009-09-13 09:51:171214configuration section of the form:</p></div>
1215<div class="listingblock">
1216<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491217<pre><tt> [url "&lt;actual url base&gt;"]
1218 pushInsteadOf = &lt;other url base&gt;</tt></pre>
Junio C Hamano7df6dcf2009-09-13 09:51:171219</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591220<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano7df6dcf2009-09-13 09:51:171221<div class="listingblock">
1222<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491223<pre><tt> [url "ssh://example.org/"]
1224 pushInsteadOf = git://example.org/</tt></pre>
Junio C Hamano7df6dcf2009-09-13 09:51:171225</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591226<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:171227"ssh://example.org/path/to/repo.git" for pushes, but pulls will still
1228use the original URL.</p></div>
Junio C Hamano330aae62007-07-06 17:01:581229</div>
Junio C Hamano9d971152012-12-19 00:43:111230</div>
1231<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311232<h2 id="_examples">Examples</h2>
Junio C Hamano1bb569e2006-05-05 23:14:251233<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591234<div class="ulist"><ul>
Junio C Hamano9ccf6642010-03-22 01:47:351235<li>
1236<p>
1237Clone from upstream:
1238</p>
Junio C Hamano1a4e8412005-12-27 08:17:231239<div class="listingblock">
1240<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491241<pre><tt>$ git clone git://git.kernel.org/pub/scm/.../linux.git my-linux
Junio C Hamanoa1952302013-07-01 21:31:181242$ cd my-linux
Junio C Hamano61525f92014-01-17 22:46:491243$ make</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231244</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351245</li>
1246<li>
1247<p>
1248Make a local clone that borrows from the current directory, without checking things out:
1249</p>
Junio C Hamano1a4e8412005-12-27 08:17:231250<div class="listingblock">
1251<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491252<pre><tt>$ git clone -l -s -n . ../copy
Junio C Hamano8638c922007-05-12 20:50:081253$ cd ../copy
Junio C Hamano61525f92014-01-17 22:46:491254$ git show-branch</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231255</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351256</li>
1257<li>
1258<p>
1259Clone from upstream while borrowing from an existing local directory:
1260</p>
Junio C Hamanof50bfec2006-04-19 09:44:121261<div class="listingblock">
1262<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491263<pre><tt>$ git clone --reference /git/linux.git \
Junio C Hamanoa1952302013-07-01 21:31:181264 git://git.kernel.org/pub/scm/.../linux.git \
1265 my-linux
Junio C Hamano61525f92014-01-17 22:46:491266$ cd my-linux</tt></pre>
Junio C Hamanof50bfec2006-04-19 09:44:121267</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351268</li>
1269<li>
1270<p>
1271Create a bare repository to publish your changes to the public:
1272</p>
Junio C Hamano38064d52006-01-15 10:13:491273<div class="listingblock">
1274<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491275<pre><tt>$ git clone --bare -l /home/proj/.git /pub/scm/proj.git</tt></pre>
Junio C Hamano38064d52006-01-15 10:13:491276</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351277</li>
Junio C Hamano9ccf6642010-03-22 01:47:351278</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:231279</div>
Junio C Hamano9d971152012-12-19 00:43:111280</div>
1281<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311282<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231283<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231284<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231285</div>
Junio C Hamano7bd050f2011-09-22 06:32:221286</div>
Junio C Hamano9d971152012-12-19 00:43:111287</div>
Junio C Hamano7bd050f2011-09-22 06:32:221288<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:231289<div id="footer">
1290<div id="footer-text">
Junio C Hamano61525f92014-01-17 22:46:491291Last updated 2014-01-17 14:43:28 PST
Junio C Hamano1a4e8412005-12-27 08:17:231292</div>
1293</div>
1294</body>
1295</html>