blob: 205c5f954d21566db2e1cdd77633d80a38353f89 [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" />
6<meta name="generator" content="AsciiDoc 8.6.8" />
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 Hamano9d971152012-12-19 00:43:1190.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2394 padding: 0;
95 margin: 0;
96}
97
Junio C Hamano9d971152012-12-19 00:43:1198
99#author {
Junio C Hamano1a4e8412005-12-27 08:17:23100 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23101 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31102 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23103}
Junio C Hamano9d971152012-12-19 00:43:11104#email {
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9d971152012-12-19 00:43:11106#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
108
Junio C Hamano9d971152012-12-19 00:43:11109#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23110 font-size: small;
111 border-top: 2px solid silver;
112 padding-top: 0.5em;
113 margin-top: 4.0em;
114}
Junio C Hamano9d971152012-12-19 00:43:11115#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23116 float: left;
117 padding-bottom: 0.5em;
118}
Junio C Hamano9d971152012-12-19 00:43:11119#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23120 float: right;
121 padding-bottom: 0.5em;
122}
123
Junio C Hamano9d971152012-12-19 00:43:11124#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59125 margin-top: 1.5em;
126 margin-bottom: 1.5em;
127}
Junio C Hamano9d971152012-12-19 00:43:11128div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23129div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23132 margin-bottom: 1.5em;
133}
134div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22135 margin-top: 2.0em;
136 margin-bottom: 2.0em;
137 margin-right: 10%;
138 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23139}
140
141div.content { /* Block element content. */
142 padding: 0;
143}
144
145/* Block element titles. */
146div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59147 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23148 font-weight: bold;
149 text-align: left;
150 margin-top: 1.0em;
151 margin-bottom: 0.5em;
152}
153div.title + * {
154 margin-top: 0;
155}
156
157td div.title:first-child {
158 margin-top: 0.0em;
159}
160div.content div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content + div.title {
164 margin-top: 0.0em;
165}
166
167div.sidebarblock > div.content {
168 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11169 border: 1px solid #dddddd;
170 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23171 padding: 0.5em;
172}
173
174div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11175 border: 1px solid #dddddd;
176 border-left: 5px solid #f0f0f0;
177 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23178 padding: 0.5em;
179}
180
Junio C Hamano7bd050f2011-09-22 06:32:22181div.quoteblock, div.verseblock {
182 padding-left: 1.0em;
183 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59184 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11185 border-left: 5px solid #f0f0f0;
186 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23187}
Junio C Hamano7bd050f2011-09-22 06:32:22188
Junio C Hamano68cf15a2010-11-06 01:01:59189div.quoteblock > div.attribution {
190 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23191 text-align: right;
192}
Junio C Hamano68cf15a2010-11-06 01:01:59193
Junio C Hamano9d971152012-12-19 00:43:11194div.verseblock > pre.content {
195 font-family: inherit;
196 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59197}
198div.verseblock > div.attribution {
199 padding-top: 0.75em;
200 text-align: left;
201}
202/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31203div.verseblock + div.attribution {
204 text-align: left;
205}
Junio C Hamano1a4e8412005-12-27 08:17:23206
207div.admonitionblock .icon {
208 vertical-align: top;
209 font-size: 1.1em;
210 font-weight: bold;
211 text-decoration: underline;
212 color: #527bbd;
213 padding-right: 0.5em;
214}
215div.admonitionblock td.content {
216 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23218}
219
220div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22221 border-left: 3px solid #dddddd;
222 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23223}
224
Junio C Hamano1a4e8412005-12-27 08:17:23225div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23226span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59227a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23228
229dl {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
233dt {
234 margin-top: 0.5em;
235 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59236 font-style: normal;
237 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23238}
239dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59240 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23241}
242
243ul, ol {
244 list-style-position: outside;
245}
Junio C Hamano68cf15a2010-11-06 01:01:59246ol.arabic {
247 list-style-type: decimal;
248}
249ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23250 list-style-type: lower-alpha;
251}
Junio C Hamano68cf15a2010-11-06 01:01:59252ol.upperalpha {
253 list-style-type: upper-alpha;
254}
255ol.lowerroman {
256 list-style-type: lower-roman;
257}
258ol.upperroman {
259 list-style-type: upper-roman;
260}
261
262div.compact ul, div.compact ol,
263div.compact p, div.compact p,
264div.compact div, div.compact div {
265 margin-top: 0.1em;
266 margin-bottom: 0.1em;
267}
Junio C Hamano1a4e8412005-12-27 08:17:23268
Junio C Hamano1a4e8412005-12-27 08:17:23269tfoot {
270 font-weight: bold;
271}
Junio C Hamano68cf15a2010-11-06 01:01:59272td > div.verse {
273 white-space: pre;
274}
Junio C Hamano68cf15a2010-11-06 01:01:59275
276div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23277 margin-top: 0.8em;
278 margin-bottom: 0.8em;
279}
Junio C Hamano68cf15a2010-11-06 01:01:59280div.hdlist tr {
281 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31282}
Junio C Hamano68cf15a2010-11-06 01:01:59283dt.hdlist1.strong, td.hdlist1.strong {
284 font-weight: bold;
285}
286td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23287 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59288 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23289 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59290 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23291}
Junio C Hamano68cf15a2010-11-06 01:01:59292td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23293 vertical-align: top;
294}
Junio C Hamano68cf15a2010-11-06 01:01:59295div.hdlist.compact tr {
296 margin: 0;
297 padding-bottom: 0;
298}
299
300.comment {
301 background: yellow;
302}
Junio C Hamano1a4e8412005-12-27 08:17:23303
Junio C Hamano7bd050f2011-09-22 06:32:22304.footnote, .footnoteref {
305 font-size: 0.8em;
306}
307
308span.footnote, span.footnoteref {
309 vertical-align: super;
310}
311
312#footnotes {
313 margin: 20px 0 20px 0;
314 padding: 7px 0 0 0;
315}
316
317#footnotes div.footnote {
318 margin: 0 0 5px 0;
319}
320
321#footnotes hr {
322 border: none;
323 border-top: 1px solid silver;
324 height: 1px;
325 text-align: left;
326 margin-left: 0;
327 width: 20%;
328 min-width: 100px;
329}
330
Junio C Hamano9d971152012-12-19 00:43:11331div.colist td {
332 padding-right: 0.5em;
333 padding-bottom: 0.3em;
334 vertical-align: top;
335}
336div.colist td img {
337 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23338}
Junio C Hamanoba4b9282008-07-06 05:20:31339
Junio C Hamano9d971152012-12-19 00:43:11340@media print {
341 #footer-badges { display: none; }
342}
343
344#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22345 margin-bottom: 2.5em;
346}
347
Junio C Hamano9d971152012-12-19 00:43:11348#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31349 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31350 font-size: 1.1em;
351 font-weight: bold;
352 margin-top: 1.0em;
353 margin-bottom: 0.1em;
354}
355
Junio C Hamano9d971152012-12-19 00:43:11356div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31357 margin-top: 0;
358 margin-bottom: 0;
359}
360div.toclevel2 {
361 margin-left: 2em;
362 font-size: 0.9em;
363}
364div.toclevel3 {
365 margin-left: 4em;
366 font-size: 0.9em;
367}
368div.toclevel4 {
369 margin-left: 6em;
370 font-size: 0.9em;
371}
Junio C Hamano9d971152012-12-19 00:43:11372
373span.aqua { color: aqua; }
374span.black { color: black; }
375span.blue { color: blue; }
376span.fuchsia { color: fuchsia; }
377span.gray { color: gray; }
378span.green { color: green; }
379span.lime { color: lime; }
380span.maroon { color: maroon; }
381span.navy { color: navy; }
382span.olive { color: olive; }
383span.purple { color: purple; }
384span.red { color: red; }
385span.silver { color: silver; }
386span.teal { color: teal; }
387span.white { color: white; }
388span.yellow { color: yellow; }
389
390span.aqua-background { background: aqua; }
391span.black-background { background: black; }
392span.blue-background { background: blue; }
393span.fuchsia-background { background: fuchsia; }
394span.gray-background { background: gray; }
395span.green-background { background: green; }
396span.lime-background { background: lime; }
397span.maroon-background { background: maroon; }
398span.navy-background { background: navy; }
399span.olive-background { background: olive; }
400span.purple-background { background: purple; }
401span.red-background { background: red; }
402span.silver-background { background: silver; }
403span.teal-background { background: teal; }
404span.white-background { background: white; }
405span.yellow-background { background: yellow; }
406
407span.big { font-size: 2em; }
408span.small { font-size: 0.6em; }
409
410span.underline { text-decoration: underline; }
411span.overline { text-decoration: overline; }
412span.line-through { text-decoration: line-through; }
413
414div.unbreakable { page-break-inside: avoid; }
415
416
417/*
418 * xhtml11 specific
419 *
420 * */
421
422div.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
455table.tableblock {
456 margin-top: 1.0em;
457 margin-bottom: 1.5em;
458}
459thead, p.tableblock.header {
460 font-weight: bold;
461 color: #527bbd;
462}
463p.tableblock {
464 margin-top: 0;
465}
466table.tableblock {
467 border-width: 3px;
468 border-spacing: 0px;
469 border-style: solid;
470 border-color: #527bbd;
471 border-collapse: collapse;
472}
473th.tableblock, td.tableblock {
474 border-width: 1px;
475 padding: 4px;
476 border-style: solid;
477 border-color: #527bbd;
478}
479
480table.tableblock.frame-topbot {
481 border-left-style: hidden;
482 border-right-style: hidden;
483}
484table.tableblock.frame-sides {
485 border-top-style: hidden;
486 border-bottom-style: hidden;
487}
488table.tableblock.frame-none {
489 border-style: hidden;
490}
491
492th.tableblock.halign-left, td.tableblock.halign-left {
493 text-align: left;
494}
495th.tableblock.halign-center, td.tableblock.halign-center {
496 text-align: center;
497}
498th.tableblock.halign-right, td.tableblock.halign-right {
499 text-align: right;
500}
501
502th.tableblock.valign-top, td.tableblock.valign-top {
503 vertical-align: top;
504}
505th.tableblock.valign-middle, td.tableblock.valign-middle {
506 vertical-align: middle;
507}
508th.tableblock.valign-bottom, td.tableblock.valign-bottom {
509 vertical-align: bottom;
510}
511
512
513/*
514 * manpage specific
515 *
516 * */
517
518body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59519 padding-top: 0.5em;
520 padding-bottom: 0.5em;
521 border-top: 2px solid silver;
522 border-bottom: 2px solid silver;
523}
Junio C Hamano9d971152012-12-19 00:43:11524body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59525 border-style: none;
526}
Junio C Hamano9d971152012-12-19 00:43:11527body.manpage div.sectionbody {
528 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59529}
530
531@media print {
Junio C Hamano9d971152012-12-19 00:43:11532 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59533}
534
Junio C Hamano1a4e8412005-12-27 08:17:23535
Junio C Hamano1a4e8412005-12-27 08:17:23536</style>
Junio C Hamano7bd050f2011-09-22 06:32:22537<script type="text/javascript">
538/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22539var asciidoc = { // Namespace.
540
541/////////////////////////////////////////////////////////////////////
542// Table Of Contents generator
543/////////////////////////////////////////////////////////////////////
544
545/* Author: Mihai Bazon, September 2002
546 * http://students.infoiasi.ro/~mishoo
547 *
548 * Table Of Content generator
549 * Version: 0.4
550 *
551 * Feel free to use this script under the terms of the GNU General Public
552 * License, as long as you do not remove or alter this notice.
553 */
554
555 /* modified by Troy D. Hanson, September 2006. License: GPL */
556 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
557
558// toclevels = 1..4.
559toc: function (toclevels) {
560
561 function getText(el) {
562 var text = "";
563 for (var i = el.firstChild; i != null; i = i.nextSibling) {
564 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
565 text += i.data;
566 else if (i.firstChild != null)
567 text += getText(i);
568 }
569 return text;
570 }
571
572 function TocEntry(el, text, toclevel) {
573 this.element = el;
574 this.text = text;
575 this.toclevel = toclevel;
576 }
577
578 function tocEntries(el, toclevels) {
579 var result = new Array;
Junio C Hamano9d971152012-12-19 00:43:11580 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22581 // Function that scans the DOM tree for header elements (the DOM2
582 // nodeIterator API would be a better technique but not supported by all
583 // browsers).
584 var iterate = function (el) {
585 for (var i = el.firstChild; i != null; i = i.nextSibling) {
586 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
587 var mo = re.exec(i.tagName);
588 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
589 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
590 }
591 iterate(i);
592 }
593 }
594 }
595 iterate(el);
596 return result;
597 }
598
599 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11600 if (!toc) {
601 return;
602 }
603
604 // Delete existing TOC entries in case we're reloading the TOC.
605 var tocEntriesToRemove = [];
606 var i;
607 for (i = 0; i < toc.childNodes.length; i++) {
608 var entry = toc.childNodes[i];
609 if (entry.nodeName.toLowerCase() == 'div'
610 && entry.getAttribute("class")
611 && entry.getAttribute("class").match(/^toclevel/))
612 tocEntriesToRemove.push(entry);
613 }
614 for (i = 0; i < tocEntriesToRemove.length; i++) {
615 toc.removeChild(tocEntriesToRemove[i]);
616 }
617
618 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22619 var entries = tocEntries(document.getElementById("content"), toclevels);
620 for (var i = 0; i < entries.length; ++i) {
621 var entry = entries[i];
622 if (entry.element.id == "")
623 entry.element.id = "_toc_" + i;
624 var a = document.createElement("a");
625 a.href = "#" + entry.element.id;
626 a.appendChild(document.createTextNode(entry.text));
627 var div = document.createElement("div");
628 div.appendChild(a);
629 div.className = "toclevel" + entry.toclevel;
630 toc.appendChild(div);
631 }
632 if (entries.length == 0)
633 toc.parentNode.removeChild(toc);
634},
635
636
637/////////////////////////////////////////////////////////////////////
638// Footnotes generator
639/////////////////////////////////////////////////////////////////////
640
641/* Based on footnote generation code from:
642 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
643 */
644
645footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11646 // Delete existing footnote entries in case we're reloading the footnodes.
647 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22648 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11649 if (!noteholder) {
650 return;
651 }
652 var entriesToRemove = [];
653 for (i = 0; i < noteholder.childNodes.length; i++) {
654 var entry = noteholder.childNodes[i];
655 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
656 entriesToRemove.push(entry);
657 }
658 for (i = 0; i < entriesToRemove.length; i++) {
659 noteholder.removeChild(entriesToRemove[i]);
660 }
661
662 // Rebuild footnote entries.
663 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22664 var spans = cont.getElementsByTagName("span");
665 var refs = {};
666 var n = 0;
667 for (i=0; i<spans.length; i++) {
668 if (spans[i].className == "footnote") {
669 n++;
Junio C Hamano9d971152012-12-19 00:43:11670 var note = spans[i].getAttribute("data-note");
671 if (!note) {
672 // Use [\s\S] in place of . so multi-line matches work.
673 // Because JavaScript has no s (dotall) regex flag.
674 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
675 spans[i].innerHTML =
676 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
677 "' title='View footnote' class='footnote'>" + n + "</a>]";
678 spans[i].setAttribute("data-note", note);
679 }
Junio C Hamano7bd050f2011-09-22 06:32:22680 noteholder.innerHTML +=
681 "<div class='footnote' id='_footnote_" + n + "'>" +
682 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
683 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22684 var id =spans[i].getAttribute("id");
685 if (id != null) refs["#"+id] = n;
686 }
687 }
688 if (n == 0)
689 noteholder.parentNode.removeChild(noteholder);
690 else {
691 // Process footnoterefs.
692 for (i=0; i<spans.length; i++) {
693 if (spans[i].className == "footnoteref") {
694 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
695 href = href.match(/#.*/)[0]; // Because IE return full URL.
696 n = refs[href];
697 spans[i].innerHTML =
698 "[<a href='#_footnote_" + n +
699 "' title='View footnote' class='footnote'>" + n + "</a>]";
700 }
701 }
702 }
Junio C Hamano9d971152012-12-19 00:43:11703},
704
705install: function(toclevels) {
706 var timerId;
707
708 function reinstall() {
709 asciidoc.footnotes();
710 if (toclevels) {
711 asciidoc.toc(toclevels);
712 }
713 }
714
715 function reinstallAndRemoveTimer() {
716 clearInterval(timerId);
717 reinstall();
718 }
719
720 timerId = setInterval(reinstall, 500);
721 if (document.addEventListener)
722 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
723 else
724 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22725}
726
727}
Junio C Hamano9d971152012-12-19 00:43:11728asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22729/*]]>*/
730</script>
Junio C Hamano1a4e8412005-12-27 08:17:23731</head>
Junio C Hamano9d971152012-12-19 00:43:11732<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23733<div id="header">
734<h1>
735git-clone(1) Manual Page
736</h1>
737<h2>NAME</h2>
738<div class="sectionbody">
739<p>git-clone -
Junio C Hamano4ec06712007-06-09 20:39:33740 Clone a repository into a new directory
Junio C Hamano1a4e8412005-12-27 08:17:23741</p>
742</div>
743</div>
Junio C Hamano7bd050f2011-09-22 06:32:22744<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11745<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59746<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23747<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58748<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11749<pre class="content"><em>git clone</em> [--template=&lt;template_directory&gt;]
Junio C Hamanoaf1987f2008-08-03 07:58:19750 [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
Junio C Hamano2bd8a742009-12-01 21:16:59751 [-o &lt;name&gt;] [-b &lt;name&gt;] [-u &lt;upload-pack&gt;] [--reference &lt;repository&gt;]
Junio C Hamanof93530e2011-05-25 23:59:59752 [--separate-git-dir &lt;git dir&gt;]
Junio C Hamanob5be0522012-01-29 22:20:19753 [--depth &lt;depth&gt;] [--[no-]single-branch]
754 [--recursive|--recurse-submodules] [--] &lt;repository&gt;
Junio C Hamano9d971152012-12-19 00:43:11755 [&lt;directory&gt;]</pre>
756<div class="attribution">
Junio C Hamano68cf15a2010-11-06 01:01:59757</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23758</div>
Junio C Hamano9d971152012-12-19 00:43:11759</div>
760<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31761<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23762<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59763<div class="paragraph"><p>Clones a repository into a newly created directory, creates
Junio C Hamano5102d9a2006-12-08 07:23:46764remote-tracking branches for each branch in the cloned repository
Junio C Hamano9d971152012-12-19 00:43:11765(visible using <code>git branch -r</code>), and creates and checks out an
Junio C Hamano68cf15a2010-11-06 01:01:59766initial branch that is forked from the cloned repository&#8217;s
Junio C Hamanoc0e55e72009-10-10 00:56:29767currently active branch.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11768<div class="paragraph"><p>After the clone, a plain <code>git fetch</code> without arguments will update
769all the remote-tracking branches, and a <code>git pull</code> without
Junio C Hamano5102d9a2006-12-08 07:23:46770arguments will in addition merge the remote master branch into the
Junio C Hamano6a8a8482012-10-01 20:59:41771current master branch, if any (this is untrue when "--single-branch"
772is given; see below).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59773<div class="paragraph"><p>This default configuration is achieved by creating references to
Junio C Hamano9d971152012-12-19 00:43:11774the remote branch heads under <code>refs/remotes/origin</code> and
775by initializing <code>remote.origin.url</code> and <code>remote.origin.fetch</code>
Junio C Hamanoba4b9282008-07-06 05:20:31776configuration variables.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23777</div>
Junio C Hamano9d971152012-12-19 00:43:11778</div>
779<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31780<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23781<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59782<div class="dlist"><dl>
783<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23784--local
785</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59786<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23787-l
788</dt>
789<dd>
790<p>
791 When the repository to clone from is on a local machine,
Junio C Hamano076ffcc2013-02-06 05:13:21792 this flag bypasses the normal "Git aware" transport
Junio C Hamano1a4e8412005-12-27 08:17:23793 mechanism and clones the repository by making a copy of
794 HEAD and everything under objects and refs directories.
Junio C Hamano9d971152012-12-19 00:43:11795 The files under <code>.git/objects/</code> directory are hardlinked
Junio C Hamano7f2b3cb2012-06-22 22:42:39796 to save space when possible.
Junio C Hamanob1d6e882007-08-11 08:30:16797</p>
Junio C Hamano9d971152012-12-19 00:43:11798<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:39799this is the default, and --local is essentially a no-op. If the
800repository is specified as a URL, then this flag is ignored (and we
Junio C Hamano9d971152012-12-19 00:43:11801never use the local optimizations). Specifying <code>--no-local</code> will
802override the default when <code>/path/to/repo</code> is given, using the regular
Junio C Hamano076ffcc2013-02-06 05:13:21803Git transport instead.</p></div>
Junio C Hamano7f2b3cb2012-06-22 22:42:39804<div class="paragraph"><p>To force copying instead of hardlinking (which may be desirable if you
805are trying to make a back-up of your repository), but still avoid the
Junio C Hamano076ffcc2013-02-06 05:13:21806usual "Git aware" transport mechanism, <code>--no-hardlinks</code> can be used.</p></div>
Junio C Hamanob1d6e882007-08-11 08:30:16807</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59808<dt class="hdlist1">
Junio C Hamanob1d6e882007-08-11 08:30:16809--no-hardlinks
810</dt>
811<dd>
812<p>
813 Optimize the cloning process from a repository on a
Junio C Hamano9d971152012-12-19 00:43:11814 local filesystem by copying files under <code>.git/objects</code>
Junio C Hamanob1d6e882007-08-11 08:30:16815 directory.
Junio C Hamano1a4e8412005-12-27 08:17:23816</p>
817</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59818<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23819--shared
820</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59821<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23822-s
823</dt>
824<dd>
825<p>
826 When the repository to clone is on the local machine,
827 instead of using hard links, automatically setup
Junio C Hamano9d971152012-12-19 00:43:11828 <code>.git/objects/info/alternates</code> to share the objects
Junio C Hamano1a4e8412005-12-27 08:17:23829 with the source repository. The resulting repository
830 starts out without any object of its own.
831</p>
Junio C Hamano68cf15a2010-11-06 01:01:59832<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:31833it unless you understand what it does. If you clone your
Junio C Hamanoa9aee782008-04-23 16:09:20834repository using this option and then delete branches (or use any
Junio C Hamano076ffcc2013-02-06 05:13:21835other Git command that makes any existing commit unreferenced) in the
Junio C Hamanoa9aee782008-04-23 16:09:20836source repository, some objects may become unreferenced (or dangling).
Junio C Hamano076ffcc2013-02-06 05:13:21837These objects may be removed by normal Git operations (such as <code>git commit</code>)
Junio C Hamano9d971152012-12-19 00:43:11838which automatically call <code>git gc --auto</code>. (See <a href="git-gc.html">git-gc(1)</a>.)
Junio C Hamanofce7c7e2008-07-02 03:06:38839If these objects are removed and were referenced by the cloned repository,
Junio C Hamanoba4b9282008-07-06 05:20:31840then the cloned repository will become corrupt.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11841<div class="paragraph"><p>Note that running <code>git repack</code> without the <code>-l</code> option in a repository
842cloned with <code>-s</code> will copy objects from the source repository into a pack
843in the cloned repository, removing the disk space savings of <code>clone -s</code>.
844It is safe, however, to run <code>git gc</code>, which uses the <code>-l</code> option by
Junio C Hamanob9376922009-08-19 00:09:13845default.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11846<div class="paragraph"><p>If you want to break the dependency of a repository cloned with <code>-s</code> on
847its source repository, you can simply run <code>git repack -a</code> to copy all
Junio C Hamanob9376922009-08-19 00:09:13848objects from the source repository into a pack in the cloned repository.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23849</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59850<dt class="hdlist1">
Junio C Hamanof50bfec2006-04-19 09:44:12851--reference &lt;repository&gt;
852</dt>
853<dd>
854<p>
Junio C Hamano35b47ca2009-09-03 18:11:54855 If the reference repository is on the local machine,
Junio C Hamano9d971152012-12-19 00:43:11856 automatically setup <code>.git/objects/info/alternates</code> to
Junio C Hamanof50bfec2006-04-19 09:44:12857 obtain objects from the reference repository. Using
858 an already existing repository as an alternate will
Junio C Hamano250f03e2007-09-10 01:33:28859 require fewer objects to be copied from the repository
Junio C Hamanof50bfec2006-04-19 09:44:12860 being cloned, reducing network and local storage costs.
861</p>
Junio C Hamano9d971152012-12-19 00:43:11862<div class="paragraph"><p><strong>NOTE</strong>: see the NOTE for the <code>--shared</code> option.</p></div>
Junio C Hamanof50bfec2006-04-19 09:44:12863</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59864<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23865--quiet
866</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59867<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23868-q
869</dt>
870<dd>
871<p>
Junio C Hamano6ce6b6c2010-01-18 01:25:50872 Operate quietly. Progress is not reported to the standard
Junio C Hamano68cf15a2010-11-06 01:01:59873 error stream. This flag is also passed to the &#8216;rsync&#8217;
Junio C Hamano3db8b412008-07-26 06:45:59874 command when given.
Junio C Hamano1a4e8412005-12-27 08:17:23875</p>
876</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59877<dt class="hdlist1">
Junio C Hamano7d06a8a2008-10-20 05:42:33878--verbose
879</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59880<dt class="hdlist1">
Junio C Hamano7d06a8a2008-10-20 05:42:33881-v
882</dt>
883<dd>
884<p>
Junio C Hamanoea90ab32010-03-15 20:32:55885 Run verbosely. Does not affect the reporting of progress status
886 to the standard error stream.
Junio C Hamano6ce6b6c2010-01-18 01:25:50887</p>
888</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59889<dt class="hdlist1">
Junio C Hamano6ce6b6c2010-01-18 01:25:50890--progress
891</dt>
892<dd>
893<p>
894 Progress status is reported on the standard error stream
895 by default when it is attached to a terminal, unless -q
896 is specified. This flag forces progress status even if the
897 standard error stream is not directed to a terminal.
Junio C Hamano7d06a8a2008-10-20 05:42:33898</p>
899</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59900<dt class="hdlist1">
Junio C Hamano1e6e0062007-07-13 05:33:25901--no-checkout
902</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59903<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23904-n
905</dt>
906<dd>
907<p>
908 No checkout of HEAD is performed after the clone is complete.
909</p>
910</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59911<dt class="hdlist1">
Junio C Hamanoe663a7a2006-01-25 12:37:28912--bare
Junio C Hamano38064d52006-01-15 10:13:49913</dt>
914<dd>
915<p>
Junio C Hamano076ffcc2013-02-06 05:13:21916 Make a <em>bare</em> Git repository. That is, instead of
Junio C Hamano9d971152012-12-19 00:43:11917 creating <code>&lt;directory&gt;</code> and placing the administrative
918 files in <code>&lt;directory&gt;/.git</code>, make the <code>&lt;directory&gt;</code>
919 itself the <code>$GIT_DIR</code>. This obviously implies the <code>-n</code>
Junio C Hamano9f292e72006-11-24 11:37:29920 because there is nowhere to check out the working tree.
921 Also the branch heads at the remote are copied directly
922 to corresponding local branch heads, without mapping
Junio C Hamano9d971152012-12-19 00:43:11923 them to <code>refs/remotes/origin/</code>. When this option is
Junio C Hamanod3361ad2007-01-01 03:20:24924 used, neither remote-tracking branches nor the related
925 configuration variables are created.
Junio C Hamano38064d52006-01-15 10:13:49926</p>
927</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59928<dt class="hdlist1">
Junio C Hamanoaf1987f2008-08-03 07:58:19929--mirror
930</dt>
931<dd>
932<p>
Junio C Hamano9d971152012-12-19 00:43:11933 Set up a mirror of the source repository. This implies <code>--bare</code>.
934 Compared to <code>--bare</code>, <code>--mirror</code> not only maps local branches of the
Junio C Hamano657fd8a2010-10-07 00:01:24935 source to local branches of the target, it maps all refs (including
Junio C Hamano97bcb482010-11-25 03:16:07936 remote-tracking branches, notes etc.) and sets up a refspec configuration such
Junio C Hamano9d971152012-12-19 00:43:11937 that all these refs are overwritten by a <code>git remote update</code> in the
Junio C Hamano657fd8a2010-10-07 00:01:24938 target repository.
Junio C Hamanoaf1987f2008-08-03 07:58:19939</p>
940</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59941<dt class="hdlist1">
Junio C Hamanodcc22ee2006-11-03 02:40:13942--origin &lt;name&gt;
943</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59944<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23945-o &lt;name&gt;
946</dt>
947<dd>
948<p>
Junio C Hamano9d971152012-12-19 00:43:11949 Instead of using the remote name <code>origin</code> to keep track
950 of the upstream repository, use <code>&lt;name&gt;</code>.
Junio C Hamano1a4e8412005-12-27 08:17:23951</p>
952</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59953<dt class="hdlist1">
Junio C Hamanoc28068f2009-09-08 00:55:23954--branch &lt;name&gt;
955</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59956<dt class="hdlist1">
Junio C Hamanoc28068f2009-09-08 00:55:23957-b &lt;name&gt;
958</dt>
959<dd>
960<p>
961 Instead of pointing the newly created HEAD to the branch pointed
Junio C Hamano9d971152012-12-19 00:43:11962 to by the cloned repository&#8217;s HEAD, point to <code>&lt;name&gt;</code> branch
Junio C Hamano6a8a8482012-10-01 20:59:41963 instead. In a non-bare repository, this is the branch that will
964 be checked out.
Junio C Hamano9d971152012-12-19 00:43:11965 <code>--branch</code> can also take tags and detaches the HEAD at that commit
Junio C Hamano6a8a8482012-10-01 20:59:41966 in the resulting repository.
Junio C Hamanoc28068f2009-09-08 00:55:23967</p>
968</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59969<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23970--upload-pack &lt;upload-pack&gt;
971</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59972<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23973-u &lt;upload-pack&gt;
974</dt>
975<dd>
976<p>
Junio C Hamano3db8b412008-07-26 06:45:59977 When given, and the repository to clone from is accessed
978 via ssh, this specifies a non-default path for the command
Junio C Hamano1a4e8412005-12-27 08:17:23979 run on the other end.
980</p>
981</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59982<dt class="hdlist1">
Junio C Hamanof31d9f52006-05-28 20:58:09983--template=&lt;template_directory&gt;
984</dt>
985<dd>
986<p>
987 Specify the directory from which templates will be used;
Junio C Hamanoa28a9202012-06-21 07:08:23988 (See the "TEMPLATE DIRECTORY" section of <a href="git-init.html">git-init(1)</a>.)
Junio C Hamanof31d9f52006-05-28 20:58:09989</p>
990</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59991<dt class="hdlist1">
Junio C Hamano708376e2011-07-19 20:02:13992--config &lt;key&gt;=&lt;value&gt;
993</dt>
994<dt class="hdlist1">
995-c &lt;key&gt;=&lt;value&gt;
996</dt>
997<dd>
998<p>
999 Set a configuration variable in the newly-created repository;
1000 this takes effect immediately after the repository is
1001 initialized, but before the remote history is fetched or any
1002 files checked out. The key is in the same format as expected by
Junio C Hamano9d971152012-12-19 00:43:111003 <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:131004 values are given for the same key, each value will be written to
1005 the config file. This makes it safe, for example, to add
1006 additional fetch refspecs to the origin remote.
1007</p>
1008</dd>
1009<dt class="hdlist1">
Junio C Hamano0bbd4672007-02-20 04:52:141010--depth &lt;depth&gt;
Junio C Hamanob288d9e2007-01-02 00:04:151011</dt>
1012<dd>
1013<p>
1014 Create a <em>shallow</em> clone with a history truncated to the
Junio C Hamano1c708832007-11-02 02:47:501015 specified number of revisions. A shallow repository has a
Junio C Hamanob288d9e2007-01-02 00:04:151016 number of limitations (you cannot clone or fetch from
1017 it, nor push from nor into it), but is adequate if you
Junio C Hamano1c708832007-11-02 02:47:501018 are only interested in the recent history of a large project
1019 with a long history, and would want to send in fixes
Junio C Hamanob288d9e2007-01-02 00:04:151020 as patches.
1021</p>
1022</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591023<dt class="hdlist1">
Junio C Hamanob5be0522012-01-29 22:20:191024--single-branch
1025</dt>
1026<dd>
1027<p>
1028 Clone only the history leading to the tip of a single branch,
Junio C Hamano9d971152012-12-19 00:43:111029 either specified by the <code>--branch</code> option or the primary
1030 branch remote&#8217;s <code>HEAD</code> points at. When creating a shallow
1031 clone with the <code>--depth</code> option, this is the default, unless
1032 <code>--no-single-branch</code> is given to fetch the histories near the
Junio C Hamanob5be0522012-01-29 22:20:191033 tips of all branches.
Junio C Hamano6a8a8482012-10-01 20:59:411034 Further fetches into the resulting repository will only update the
Junio C Hamanoa1295452012-11-13 22:32:041035 remote-tracking branch for the branch this option was used for the
Junio C Hamano6a8a8482012-10-01 20:59:411036 initial cloning. If the HEAD at the remote did not point at any
Junio C Hamano9d971152012-12-19 00:43:111037 branch when <code>--single-branch</code> clone was made, no remote-tracking
Junio C Hamano6a8a8482012-10-01 20:59:411038 branch is created.
Junio C Hamanob5be0522012-01-29 22:20:191039</p>
1040</dd>
1041<dt class="hdlist1">
Junio C Hamano0e066b92009-08-28 01:08:411042--recursive
1043</dt>
Junio C Hamanoed69a742010-12-01 03:09:231044<dt class="hdlist1">
1045--recurse-submodules
1046</dt>
Junio C Hamano0e066b92009-08-28 01:08:411047<dd>
1048<p>
1049 After the clone is created, initialize all submodules within,
1050 using their default settings. This is equivalent to running
Junio C Hamano9d971152012-12-19 00:43:111051 <code>git submodule update --init --recursive</code> immediately after
Junio C Hamano0e066b92009-08-28 01:08:411052 the clone is finished. This option is ignored if the cloned
1053 repository does not have a worktree/checkout (i.e. if any of
Junio C Hamano9d971152012-12-19 00:43:111054 <code>--no-checkout</code>/<code>-n</code>, <code>--bare</code>, or <code>--mirror</code> is given)
Junio C Hamano0e066b92009-08-28 01:08:411055</p>
1056</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591057<dt class="hdlist1">
Junio C Hamanoa03ac862011-04-02 04:32:291058--separate-git-dir=&lt;git dir&gt;
1059</dt>
1060<dd>
1061<p>
1062 Instead of placing the cloned repository where it is supposed
1063 to be, place the cloned repository at the specified directory,
Junio C Hamano076ffcc2013-02-06 05:13:211064 then make a filesytem-agnostic Git symbolic link to there.
1065 The result is Git repository can be separated from working
Junio C Hamanoa03ac862011-04-02 04:32:291066 tree.
1067</p>
1068</dd>
1069<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231070&lt;repository&gt;
1071</dt>
1072<dd>
1073<p>
Junio C Hamano330aae62007-07-06 17:01:581074 The (possibly remote) repository to clone from. See the
1075 <a href="#URLS">URLS</a> section below for more information on specifying
1076 repositories.
Junio C Hamano1a4e8412005-12-27 08:17:231077</p>
1078</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591079<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231080&lt;directory&gt;
1081</dt>
1082<dd>
1083<p>
1084 The name of a new directory to clone into. The "humanish"
1085 part of the source repository is used if no directory is
Junio C Hamano9d971152012-12-19 00:43:111086 explicitly given (<code>repo</code> for <code>/path/to/repo.git</code> and <code>foo</code>
1087 for <code>host.xz:foo/.git</code>). Cloning into an existing directory
Junio C Hamano89bdb3b2009-05-10 06:48:141088 is only allowed if the directory is empty.
Junio C Hamano1a4e8412005-12-27 08:17:231089</p>
1090</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311091</dl></div>
Junio C Hamano1bb569e2006-05-05 23:14:251092</div>
Junio C Hamano9d971152012-12-19 00:43:111093</div>
1094<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311095<h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2>
Junio C Hamano330aae62007-07-06 17:01:581096<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591097<div class="paragraph"><p>In general, URLs contain information about the transport protocol, the
Junio C Hamano0c053e82010-04-19 06:46:341098address of the remote server, and the path to the repository.
1099Depending on the transport protocol, some of this information may be
1100absent.</p></div>
Junio C Hamano6631a092012-10-10 22:50:571101<div class="paragraph"><p>Git supports ssh, git, http, and https protocols (in addition, ftp,
1102and ftps can be used for fetching and rsync can be used for fetching
1103and pushing, but these are inefficient and deprecated; do not use
1104them).</p></div>
1105<div class="paragraph"><p>The following syntaxes may be used with them:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591106<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:581107<li>
1108<p>
Junio C Hamano0c053e82010-04-19 06:46:341109ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581110</p>
1111</li>
1112<li>
1113<p>
Junio C Hamanoa3bb6eb2009-02-05 01:26:331114git://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581115</p>
1116</li>
1117<li>
1118<p>
Junio C Hamano0c053e82010-04-19 06:46:341119http&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581120</p>
1121</li>
1122<li>
1123<p>
Junio C Hamano0c053e82010-04-19 06:46:341124ftp&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamanodbb64592007-09-01 11:17:391125</p>
1126</li>
1127<li>
1128<p>
Junio C Hamano0c053e82010-04-19 06:46:341129rsync://host.xz/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581130</p>
1131</li>
Junio C Hamanoba4b9282008-07-06 05:20:311132</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591133<div class="paragraph"><p>An alternative scp-like syntax may also be used with the ssh protocol:</p></div>
1134<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:581135<li>
1136<p>
Junio C Hamano0c053e82010-04-19 06:46:341137&#91;user@&#93;host.xz:path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:581138</p>
1139</li>
Junio C Hamanoba4b9282008-07-06 05:20:311140</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591141<div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
1142<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:341143<li>
1144<p>
1145ssh://&#91;user@&#93;host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1146</p>
1147</li>
1148<li>
1149<p>
1150git://host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1151</p>
1152</li>
1153<li>
1154<p>
1155&#91;user@&#93;host.xz:/~&#91;user&#93;/path/to/repo.git/
1156</p>
1157</li>
1158</ul></div>
Junio C Hamano076ffcc2013-02-06 05:13:211159<div class="paragraph"><p>For local repositories, also supported by Git natively, the following
Junio C Hamano0c053e82010-04-19 06:46:341160syntaxes may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591161<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:581162<li>
1163<p>
1164/path/to/repo.git/
1165</p>
1166</li>
Junio C Hamanob1d6e882007-08-11 08:30:161167<li>
1168<p>
Junio C Hamano68cf15a2010-11-06 01:01:591169<a href="file:///path/to/repo.git/">file:///path/to/repo.git/</a>
Junio C Hamanob1d6e882007-08-11 08:30:161170</p>
1171</li>
Junio C Hamanoba4b9282008-07-06 05:20:311172</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591173<div class="paragraph"><p>These two syntaxes are mostly equivalent, except the former implies
Junio C Hamano0c053e82010-04-19 06:46:341174--local option.</p></div>
Junio C Hamano076ffcc2013-02-06 05:13:211175<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:341176attempts to use the <em>remote-&lt;transport&gt;</em> remote helper, if one
1177exists. To explicitly request a remote helper, the following syntax
1178may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591179<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:341180<li>
1181<p>
1182&lt;transport&gt;::&lt;address&gt;
1183</p>
1184</li>
1185</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591186<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:341187URL-like string recognized by the specific remote helper being
Junio C Hamanoa28a9202012-06-21 07:08:231188invoked. See <a href="git-remote-helpers.html">git-remote-helpers(1)</a> for details.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591189<div class="paragraph"><p>If there are a large number of similarly-named remote repositories and
Junio C Hamano24bc09a2008-02-28 00:27:441190you want to use a different format for them (such that the URLs you
1191use will be rewritten into URLs that work), you can create a
Junio C Hamanoba4b9282008-07-06 05:20:311192configuration section of the form:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441193<div class="listingblock">
1194<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111195<pre><code> [url "&lt;actual url base&gt;"]
1196 insteadOf = &lt;other url base&gt;</code></pre>
Junio C Hamano24bc09a2008-02-28 00:27:441197</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591198<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441199<div class="listingblock">
1200<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111201<pre><code> [url "git://git.host.xz/"]
Junio C Hamano24bc09a2008-02-28 00:27:441202 insteadOf = host.xz:/path/to/
Junio C Hamano9d971152012-12-19 00:43:111203 insteadOf = work:</code></pre>
Junio C Hamano24bc09a2008-02-28 00:27:441204</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591205<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:311206rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591207<div class="paragraph"><p>If you want to rewrite URLs for push only, you can create a
Junio C Hamano7df6dcf2009-09-13 09:51:171208configuration section of the form:</p></div>
1209<div class="listingblock">
1210<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111211<pre><code> [url "&lt;actual url base&gt;"]
1212 pushInsteadOf = &lt;other url base&gt;</code></pre>
Junio C Hamano7df6dcf2009-09-13 09:51:171213</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591214<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano7df6dcf2009-09-13 09:51:171215<div class="listingblock">
1216<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111217<pre><code> [url "ssh://example.org/"]
1218 pushInsteadOf = git://example.org/</code></pre>
Junio C Hamano7df6dcf2009-09-13 09:51:171219</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591220<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:171221"ssh://example.org/path/to/repo.git" for pushes, but pulls will still
1222use the original URL.</p></div>
Junio C Hamano330aae62007-07-06 17:01:581223</div>
Junio C Hamano9d971152012-12-19 00:43:111224</div>
1225<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311226<h2 id="_examples">Examples</h2>
Junio C Hamano1bb569e2006-05-05 23:14:251227<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591228<div class="ulist"><ul>
Junio C Hamano9ccf6642010-03-22 01:47:351229<li>
1230<p>
1231Clone from upstream:
1232</p>
Junio C Hamano1a4e8412005-12-27 08:17:231233<div class="listingblock">
1234<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111235<pre><code>$ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
Junio C Hamano1a4e8412005-12-27 08:17:231236$ cd my2.6
Junio C Hamano9d971152012-12-19 00:43:111237$ make</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231238</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351239</li>
1240<li>
1241<p>
1242Make a local clone that borrows from the current directory, without checking things out:
1243</p>
Junio C Hamano1a4e8412005-12-27 08:17:231244<div class="listingblock">
1245<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111246<pre><code>$ git clone -l -s -n . ../copy
Junio C Hamano8638c922007-05-12 20:50:081247$ cd ../copy
Junio C Hamano9d971152012-12-19 00:43:111248$ git show-branch</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231249</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351250</li>
1251<li>
1252<p>
1253Clone from upstream while borrowing from an existing local directory:
1254</p>
Junio C Hamanof50bfec2006-04-19 09:44:121255<div class="listingblock">
1256<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111257<pre><code>$ git clone --reference my2.6 \
Junio C Hamanof50bfec2006-04-19 09:44:121258 git://git.kernel.org/pub/scm/.../linux-2.7 \
1259 my2.7
Junio C Hamano9d971152012-12-19 00:43:111260$ cd my2.7</code></pre>
Junio C Hamanof50bfec2006-04-19 09:44:121261</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351262</li>
1263<li>
1264<p>
1265Create a bare repository to publish your changes to the public:
1266</p>
Junio C Hamano38064d52006-01-15 10:13:491267<div class="listingblock">
1268<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111269<pre><code>$ git clone --bare -l /home/proj/.git /pub/scm/proj.git</code></pre>
Junio C Hamano38064d52006-01-15 10:13:491270</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351271</li>
1272<li>
1273<p>
1274Create a repository on the kernel.org machine that borrows from Linus:
1275</p>
Junio C Hamano38064d52006-01-15 10:13:491276<div class="listingblock">
1277<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111278<pre><code>$ git clone --bare -l -s /pub/scm/.../torvalds/linux-2.6.git \
1279 /pub/scm/.../me/subsys-2.6.git</code></pre>
Junio C Hamano38064d52006-01-15 10:13:491280</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351281</li>
1282</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:231283</div>
Junio C Hamano9d971152012-12-19 00:43:111284</div>
1285<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311286<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231287<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231288<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231289</div>
Junio C Hamano7bd050f2011-09-22 06:32:221290</div>
Junio C Hamano9d971152012-12-19 00:43:111291</div>
Junio C Hamano7bd050f2011-09-22 06:32:221292<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:231293<div id="footer">
1294<div id="footer-text">
Junio C Hamano076ffcc2013-02-06 05:13:211295Last updated 2013-02-05 21:07:26 PST
Junio C Hamano1a4e8412005-12-27 08:17:231296</div>
1297</div>
1298</body>
1299</html>