blob: 02feb8800e4a6df345a891dbb9933a338608bec2 [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>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamano7bd050f2011-09-22 06:32:226<meta name="generator" content="AsciiDoc 8.5.2" />
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">
9/* Debug borders */
10p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11/*
12 border: 1px solid red;
13*/
14}
15
16body {
17 margin: 1em 5% 1em 5%;
18}
19
Junio C Hamanoba4b9282008-07-06 05:20:3120a {
21 color: blue;
22 text-decoration: underline;
23}
24a:visited {
25 color: fuchsia;
26}
Junio C Hamano1a4e8412005-12-27 08:17:2327
28em {
29 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5930 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2331}
32
33strong {
34 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5935 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2336}
37
38tt {
39 color: navy;
40}
41
42h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
48}
49
Junio C Hamanoba4b9282008-07-06 05:20:3150h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 border-bottom: 2px solid silver;
52}
53h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2354 padding-top: 0.5em;
55}
Junio C Hamanoba4b9282008-07-06 05:20:3156h3 {
57 float: left;
58}
59h3 + * {
60 clear: left;
61}
Junio C Hamano1a4e8412005-12-27 08:17:2362
63div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
66}
67
68hr {
69 border: 1px solid silver;
70}
71
72p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
75}
76
Junio C Hamano68cf15a2010-11-06 01:01:5977ul, ol, li > p {
78 margin-top: 0;
79}
80
Junio C Hamano1a4e8412005-12-27 08:17:2381pre {
82 padding: 0;
83 margin: 0;
84}
85
86span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3190 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2391}
92span#email {
93}
Junio C Hamano68cf15a2010-11-06 01:01:5994span#revnumber, span#revdate, span#revremark {
Junio C Hamano1a4e8412005-12-27 08:17:2395 font-family: sans-serif;
96}
97
98div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
104}
105div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
108}
109div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
112}
113
Junio C Hamano68cf15a2010-11-06 01:01:59114div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
117}
Junio C Hamano1a4e8412005-12-27 08:17:23118div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22121 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23122 margin-bottom: 1.5em;
123}
124div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23129}
130
131div.content { /* Block element content. */
132 padding: 0;
133}
134
135/* Block element titles. */
136div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59137 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
143}
144div.title + * {
145 margin-top: 0;
146}
147
148td div.title:first-child {
149 margin-top: 0.0em;
150}
151div.content div.title:first-child {
152 margin-top: 0.0em;
153}
154div.content + div.title {
155 margin-top: 0.0em;
156}
157
158div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
162}
163
164div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
168}
169
Junio C Hamano7bd050f2011-09-22 06:32:22170div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59173 margin-right: 10%;
Junio C Hamano7bd050f2011-09-22 06:32:22174 border-left: 5px solid #dddddd;
175 color: #777777;
Junio C Hamano1a4e8412005-12-27 08:17:23176}
Junio C Hamano7bd050f2011-09-22 06:32:22177
Junio C Hamano68cf15a2010-11-06 01:01:59178div.quoteblock > div.attribution {
179 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23180 text-align: right;
181}
Junio C Hamano68cf15a2010-11-06 01:01:59182
Junio C Hamano68cf15a2010-11-06 01:01:59183div.verseblock > div.content {
184 white-space: pre;
185}
186div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
189}
190/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31191div.verseblock + div.attribution {
192 text-align: left;
193}
Junio C Hamano1a4e8412005-12-27 08:17:23194
195div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
202}
203div.admonitionblock td.content {
204 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22205 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23206}
207
208div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23211}
212
Junio C Hamano1a4e8412005-12-27 08:17:23213div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23214span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59215a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23216
217dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
220}
221dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59224 font-style: normal;
225 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23226}
227dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59228 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23229}
230
231ul, ol {
232 list-style-position: outside;
233}
Junio C Hamano68cf15a2010-11-06 01:01:59234ol.arabic {
235 list-style-type: decimal;
236}
237ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23238 list-style-type: lower-alpha;
239}
Junio C Hamano68cf15a2010-11-06 01:01:59240ol.upperalpha {
241 list-style-type: upper-alpha;
242}
243ol.lowerroman {
244 list-style-type: lower-roman;
245}
246ol.upperroman {
247 list-style-type: upper-roman;
248}
249
250div.compact ul, div.compact ol,
251div.compact p, div.compact p,
252div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
255}
Junio C Hamano1a4e8412005-12-27 08:17:23256
257div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31258 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23259}
Junio C Hamano7bd050f2011-09-22 06:32:22260thead, p.table.header {
Junio C Hamano1a4e8412005-12-27 08:17:23261 font-family: sans-serif;
262 font-weight: bold;
263}
264tfoot {
265 font-weight: bold;
266}
Junio C Hamano68cf15a2010-11-06 01:01:59267td > div.verse {
268 white-space: pre;
269}
270p.table {
271 margin-top: 0;
272}
273/* Because the table frame attribute is overriden by CSS in most browsers. */
274div.tableblock > table[frame="void"] {
275 border-style: none;
276}
277div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
280}
281div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
284}
Junio C Hamano1a4e8412005-12-27 08:17:23285
Junio C Hamano68cf15a2010-11-06 01:01:59286
287div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
290}
Junio C Hamano68cf15a2010-11-06 01:01:59291div.hdlist tr {
292 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31293}
Junio C Hamano68cf15a2010-11-06 01:01:59294dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
296}
297td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23298 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59299 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23300 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59301 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23302}
Junio C Hamano68cf15a2010-11-06 01:01:59303td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23304 vertical-align: top;
305}
Junio C Hamano68cf15a2010-11-06 01:01:59306div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
309}
310
311.comment {
312 background: yellow;
313}
Junio C Hamano1a4e8412005-12-27 08:17:23314
Junio C Hamano7bd050f2011-09-22 06:32:22315.footnote, .footnoteref {
316 font-size: 0.8em;
317}
318
319span.footnote, span.footnoteref {
320 vertical-align: super;
321}
322
323#footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
326}
327
328#footnotes div.footnote {
329 margin: 0 0 5px 0;
330}
331
332#footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
340}
341
342
Junio C Hamano1a4e8412005-12-27 08:17:23343@media print {
344 div#footer-badges { display: none; }
345}
Junio C Hamanoba4b9282008-07-06 05:20:31346
Junio C Hamano7bd050f2011-09-22 06:32:22347div#toc {
348 margin-bottom: 2.5em;
349}
350
Junio C Hamanoba4b9282008-07-06 05:20:31351div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
358}
359
360div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
363}
364div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
367}
368div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
371}
372div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
375}
Junio C Hamano68cf15a2010-11-06 01:01:59376/* Overrides for manpage documents */
377h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
382}
383h2 {
384 border-style: none;
385}
386div.sectionbody {
387 margin-left: 5%;
388}
389
390@media print {
391 div#toc { display: none; }
392}
393
Junio C Hamano1a4e8412005-12-27 08:17:23394/* Workarounds for IE6's broken and incomplete CSS2. */
395
396div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
400}
401div.sidebar-title, div.image-title {
Junio C Hamano68cf15a2010-11-06 01:01:59402 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
407}
408
409div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
413}
414
Junio C Hamano68cf15a2010-11-06 01:01:59415div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
418}
419
420div.verseblock-content {
421 white-space: pre;
422}
423div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
Junio C Hamano1a4e8412005-12-27 08:17:23426}
427
428div.exampleblock-content {
Junio C Hamano7bd050f2011-09-22 06:32:22429 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23430 padding-left: 0.5em;
431}
Junio C Hamanoba4b9282008-07-06 05:20:31432
433/* IE6 sets dynamically generated links as visited. */
434div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23435</style>
Junio C Hamano7bd050f2011-09-22 06:32:22436<script type="text/javascript">
437/*<![CDATA[*/
438window.onload = function(){asciidoc.footnotes();}
439var asciidoc = { // Namespace.
440
441/////////////////////////////////////////////////////////////////////
442// Table Of Contents generator
443/////////////////////////////////////////////////////////////////////
444
445/* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
447 *
448 * Table Of Content generator
449 * Version: 0.4
450 *
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
453 */
454
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
457
458// toclevels = 1..4.
459toc: function (toclevels) {
460
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
468 }
469 return text;
470 }
471
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
476 }
477
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
490 }
491 iterate(i);
492 }
493 }
494 }
495 iterate(el);
496 return result;
497 }
498
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
512 }
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
515},
516
517
518/////////////////////////////////////////////////////////////////////
519// Footnotes generator
520/////////////////////////////////////////////////////////////////////
521
522/* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
524 */
525
526footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
547 }
548 }
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
561 }
562 }
563 }
564}
565
566}
567/*]]>*/
568</script>
Junio C Hamano1a4e8412005-12-27 08:17:23569</head>
570<body>
571<div id="header">
572<h1>
573git-clone(1) Manual Page
574</h1>
575<h2>NAME</h2>
576<div class="sectionbody">
577<p>git-clone -
Junio C Hamano4ec06712007-06-09 20:39:33578 Clone a repository into a new directory
Junio C Hamano1a4e8412005-12-27 08:17:23579</p>
580</div>
581</div>
Junio C Hamano7bd050f2011-09-22 06:32:22582<div id="content">
Junio C Hamano68cf15a2010-11-06 01:01:59583<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23584<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58585<div class="verseblock">
Junio C Hamano68cf15a2010-11-06 01:01:59586<div class="verseblock-content"><em>git clone</em> [--template=&lt;template_directory&gt;]
Junio C Hamanoaf1987f2008-08-03 07:58:19587 [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
Junio C Hamano2bd8a742009-12-01 21:16:59588 [-o &lt;name&gt;] [-b &lt;name&gt;] [-u &lt;upload-pack&gt;] [--reference &lt;repository&gt;]
Junio C Hamanof93530e2011-05-25 23:59:59589 [--separate-git-dir &lt;git dir&gt;]
Junio C Hamanob5be0522012-01-29 22:20:19590 [--depth &lt;depth&gt;] [--[no-]single-branch]
591 [--recursive|--recurse-submodules] [--] &lt;repository&gt;
Junio C Hamanoed69a742010-12-01 03:09:23592 [&lt;directory&gt;]</div>
Junio C Hamano68cf15a2010-11-06 01:01:59593<div class="verseblock-attribution">
594</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23595</div>
Junio C Hamanoba4b9282008-07-06 05:20:31596<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23597<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59598<div class="paragraph"><p>Clones a repository into a newly created directory, creates
Junio C Hamano5102d9a2006-12-08 07:23:46599remote-tracking branches for each branch in the cloned repository
Junio C Hamanoc0e55e72009-10-10 00:56:29600(visible using <tt>git branch -r</tt>), and creates and checks out an
Junio C Hamano68cf15a2010-11-06 01:01:59601initial branch that is forked from the cloned repository&#8217;s
Junio C Hamanoc0e55e72009-10-10 00:56:29602currently active branch.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59603<div class="paragraph"><p>After the clone, a plain <tt>git fetch</tt> without arguments will update
Junio C Hamano5102d9a2006-12-08 07:23:46604all the remote-tracking branches, and a <tt>git pull</tt> without
605arguments will in addition merge the remote master branch into the
Junio C Hamanoba4b9282008-07-06 05:20:31606current master branch, if any.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59607<div class="paragraph"><p>This default configuration is achieved by creating references to
Junio C Hamano4fdccb22010-02-19 09:58:14608the remote branch heads under <tt>refs/remotes/origin</tt> and
Junio C Hamano5102d9a2006-12-08 07:23:46609by initializing <tt>remote.origin.url</tt> and <tt>remote.origin.fetch</tt>
Junio C Hamanoba4b9282008-07-06 05:20:31610configuration variables.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23611</div>
Junio C Hamanoba4b9282008-07-06 05:20:31612<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23613<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59614<div class="dlist"><dl>
615<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23616--local
617</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59618<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23619-l
620</dt>
621<dd>
622<p>
623 When the repository to clone from is on a local machine,
Junio C Hamano621e1232009-10-26 05:16:47624 this flag bypasses the normal "git aware" transport
Junio C Hamano1a4e8412005-12-27 08:17:23625 mechanism and clones the repository by making a copy of
626 HEAD and everything under objects and refs directories.
Junio C Hamanob1d6e882007-08-11 08:30:16627 The files under <tt>.git/objects/</tt> directory are hardlinked
628 to save space when possible. This is now the default when
629 the source repository is specified with <tt>/path/to/repo</tt>
630 syntax, so it essentially is a no-op option. To force
631 copying instead of hardlinking (which may be desirable
632 if you are trying to make a back-up of your repository),
633 but still avoid the usual "git aware" transport
634 mechanism, <tt>--no-hardlinks</tt> can be used.
635</p>
636</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59637<dt class="hdlist1">
Junio C Hamanob1d6e882007-08-11 08:30:16638--no-hardlinks
639</dt>
640<dd>
641<p>
642 Optimize the cloning process from a repository on a
643 local filesystem by copying files under <tt>.git/objects</tt>
644 directory.
Junio C Hamano1a4e8412005-12-27 08:17:23645</p>
646</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59647<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23648--shared
649</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59650<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23651-s
652</dt>
653<dd>
654<p>
655 When the repository to clone is on the local machine,
656 instead of using hard links, automatically setup
Junio C Hamano621e1232009-10-26 05:16:47657 <tt>.git/objects/info/alternates</tt> to share the objects
Junio C Hamano1a4e8412005-12-27 08:17:23658 with the source repository. The resulting repository
659 starts out without any object of its own.
660</p>
Junio C Hamano68cf15a2010-11-06 01:01:59661<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:31662it unless you understand what it does. If you clone your
Junio C Hamanoa9aee782008-04-23 16:09:20663repository using this option and then delete branches (or use any
664other git command that makes any existing commit unreferenced) in the
665source repository, some objects may become unreferenced (or dangling).
Junio C Hamano621e1232009-10-26 05:16:47666These objects may be removed by normal git operations (such as <tt>git commit</tt>)
Junio C Hamanofce7c7e2008-07-02 03:06:38667which automatically call <tt>git gc --auto</tt>. (See <a href="git-gc.html">git-gc(1)</a>.)
668If these objects are removed and were referenced by the cloned repository,
Junio C Hamanoba4b9282008-07-06 05:20:31669then the cloned repository will become corrupt.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59670<div class="paragraph"><p>Note that running <tt>git repack</tt> without the <tt>-l</tt> option in a repository
Junio C Hamanob9376922009-08-19 00:09:13671cloned with <tt>-s</tt> will copy objects from the source repository into a pack
672in the cloned repository, removing the disk space savings of <tt>clone -s</tt>.
673It is safe, however, to run <tt>git gc</tt>, which uses the <tt>-l</tt> option by
674default.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59675<div class="paragraph"><p>If you want to break the dependency of a repository cloned with <tt>-s</tt> on
Junio C Hamanob9376922009-08-19 00:09:13676its source repository, you can simply run <tt>git repack -a</tt> to copy all
677objects from the source repository into a pack in the cloned repository.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23678</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59679<dt class="hdlist1">
Junio C Hamanof50bfec2006-04-19 09:44:12680--reference &lt;repository&gt;
681</dt>
682<dd>
683<p>
Junio C Hamano35b47ca2009-09-03 18:11:54684 If the reference repository is on the local machine,
Junio C Hamano621e1232009-10-26 05:16:47685 automatically setup <tt>.git/objects/info/alternates</tt> to
Junio C Hamanof50bfec2006-04-19 09:44:12686 obtain objects from the reference repository. Using
687 an already existing repository as an alternate will
Junio C Hamano250f03e2007-09-10 01:33:28688 require fewer objects to be copied from the repository
Junio C Hamanof50bfec2006-04-19 09:44:12689 being cloned, reducing network and local storage costs.
690</p>
Junio C Hamano68cf15a2010-11-06 01:01:59691<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:12692</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59693<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23694--quiet
695</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59696<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23697-q
698</dt>
699<dd>
700<p>
Junio C Hamano6ce6b6c2010-01-18 01:25:50701 Operate quietly. Progress is not reported to the standard
Junio C Hamano68cf15a2010-11-06 01:01:59702 error stream. This flag is also passed to the &#8216;rsync&#8217;
Junio C Hamano3db8b412008-07-26 06:45:59703 command when given.
Junio C Hamano1a4e8412005-12-27 08:17:23704</p>
705</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59706<dt class="hdlist1">
Junio C Hamano7d06a8a2008-10-20 05:42:33707--verbose
708</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59709<dt class="hdlist1">
Junio C Hamano7d06a8a2008-10-20 05:42:33710-v
711</dt>
712<dd>
713<p>
Junio C Hamanoea90ab32010-03-15 20:32:55714 Run verbosely. Does not affect the reporting of progress status
715 to the standard error stream.
Junio C Hamano6ce6b6c2010-01-18 01:25:50716</p>
717</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59718<dt class="hdlist1">
Junio C Hamano6ce6b6c2010-01-18 01:25:50719--progress
720</dt>
721<dd>
722<p>
723 Progress status is reported on the standard error stream
724 by default when it is attached to a terminal, unless -q
725 is specified. This flag forces progress status even if the
726 standard error stream is not directed to a terminal.
Junio C Hamano7d06a8a2008-10-20 05:42:33727</p>
728</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59729<dt class="hdlist1">
Junio C Hamano1e6e0062007-07-13 05:33:25730--no-checkout
731</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59732<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23733-n
734</dt>
735<dd>
736<p>
737 No checkout of HEAD is performed after the clone is complete.
738</p>
739</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59740<dt class="hdlist1">
Junio C Hamanoe663a7a2006-01-25 12:37:28741--bare
Junio C Hamano38064d52006-01-15 10:13:49742</dt>
743<dd>
744<p>
Junio C Hamanoe663a7a2006-01-25 12:37:28745 Make a <em>bare</em> GIT repository. That is, instead of
Junio C Hamano38064d52006-01-15 10:13:49746 creating <tt>&lt;directory&gt;</tt> and placing the administrative
747 files in <tt>&lt;directory&gt;/.git</tt>, make the <tt>&lt;directory&gt;</tt>
Junio C Hamano9f292e72006-11-24 11:37:29748 itself the <tt>$GIT_DIR</tt>. This obviously implies the <tt>-n</tt>
749 because there is nowhere to check out the working tree.
750 Also the branch heads at the remote are copied directly
751 to corresponding local branch heads, without mapping
752 them to <tt>refs/remotes/origin/</tt>. When this option is
Junio C Hamanod3361ad2007-01-01 03:20:24753 used, neither remote-tracking branches nor the related
754 configuration variables are created.
Junio C Hamano38064d52006-01-15 10:13:49755</p>
756</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59757<dt class="hdlist1">
Junio C Hamanoaf1987f2008-08-03 07:58:19758--mirror
759</dt>
760<dd>
761<p>
Junio C Hamano657fd8a2010-10-07 00:01:24762 Set up a mirror of the source repository. This implies <tt>--bare</tt>.
763 Compared to <tt>--bare</tt>, <tt>--mirror</tt> not only maps local branches of the
764 source to local branches of the target, it maps all refs (including
Junio C Hamano97bcb482010-11-25 03:16:07765 remote-tracking branches, notes etc.) and sets up a refspec configuration such
Junio C Hamano657fd8a2010-10-07 00:01:24766 that all these refs are overwritten by a <tt>git remote update</tt> in the
767 target repository.
Junio C Hamanoaf1987f2008-08-03 07:58:19768</p>
769</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59770<dt class="hdlist1">
Junio C Hamanodcc22ee2006-11-03 02:40:13771--origin &lt;name&gt;
772</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59773<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23774-o &lt;name&gt;
775</dt>
776<dd>
777<p>
Junio C Hamano621e1232009-10-26 05:16:47778 Instead of using the remote name <tt>origin</tt> to keep track
779 of the upstream repository, use <tt>&lt;name&gt;</tt>.
Junio C Hamano1a4e8412005-12-27 08:17:23780</p>
781</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59782<dt class="hdlist1">
Junio C Hamanoc28068f2009-09-08 00:55:23783--branch &lt;name&gt;
784</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59785<dt class="hdlist1">
Junio C Hamanoc28068f2009-09-08 00:55:23786-b &lt;name&gt;
787</dt>
788<dd>
789<p>
790 Instead of pointing the newly created HEAD to the branch pointed
Junio C Hamano68cf15a2010-11-06 01:01:59791 to by the cloned repository&#8217;s HEAD, point to <tt>&lt;name&gt;</tt> branch
Junio C Hamanoc28068f2009-09-08 00:55:23792 instead. In a non-bare repository, this is the branch that will
793 be checked out.
794</p>
795</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59796<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23797--upload-pack &lt;upload-pack&gt;
798</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59799<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23800-u &lt;upload-pack&gt;
801</dt>
802<dd>
803<p>
Junio C Hamano3db8b412008-07-26 06:45:59804 When given, and the repository to clone from is accessed
805 via ssh, this specifies a non-default path for the command
Junio C Hamano1a4e8412005-12-27 08:17:23806 run on the other end.
807</p>
808</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59809<dt class="hdlist1">
Junio C Hamanof31d9f52006-05-28 20:58:09810--template=&lt;template_directory&gt;
811</dt>
812<dd>
813<p>
814 Specify the directory from which templates will be used;
Junio C Hamanocaa712a2010-03-11 01:17:35815 (See the "TEMPLATE DIRECTORY" section of <a href="git-init.html">git-init(1)</a>.)
Junio C Hamanof31d9f52006-05-28 20:58:09816</p>
817</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59818<dt class="hdlist1">
Junio C Hamano708376e2011-07-19 20:02:13819--config &lt;key&gt;=&lt;value&gt;
820</dt>
821<dt class="hdlist1">
822-c &lt;key&gt;=&lt;value&gt;
823</dt>
824<dd>
825<p>
826 Set a configuration variable in the newly-created repository;
827 this takes effect immediately after the repository is
828 initialized, but before the remote history is fetched or any
829 files checked out. The key is in the same format as expected by
830 <a href="git-config.html">git-config(1)</a> (e.g., <tt>core.eol=true</tt>). If multiple
831 values are given for the same key, each value will be written to
832 the config file. This makes it safe, for example, to add
833 additional fetch refspecs to the origin remote.
834</p>
835</dd>
836<dt class="hdlist1">
Junio C Hamano0bbd4672007-02-20 04:52:14837--depth &lt;depth&gt;
Junio C Hamanob288d9e2007-01-02 00:04:15838</dt>
839<dd>
840<p>
841 Create a <em>shallow</em> clone with a history truncated to the
Junio C Hamano1c708832007-11-02 02:47:50842 specified number of revisions. A shallow repository has a
Junio C Hamanob288d9e2007-01-02 00:04:15843 number of limitations (you cannot clone or fetch from
844 it, nor push from nor into it), but is adequate if you
Junio C Hamano1c708832007-11-02 02:47:50845 are only interested in the recent history of a large project
846 with a long history, and would want to send in fixes
Junio C Hamanob288d9e2007-01-02 00:04:15847 as patches.
848</p>
849</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59850<dt class="hdlist1">
Junio C Hamanob5be0522012-01-29 22:20:19851--single-branch
852</dt>
853<dd>
854<p>
855 Clone only the history leading to the tip of a single branch,
856 either specified by the <tt>--branch</tt> option or the primary
857 branch remote&#8217;s <tt>HEAD</tt> points at. When creating a shallow
858 clone with the <tt>--depth</tt> option, this is the default, unless
859 <tt>--no-single-branch</tt> is given to fetch the histories near the
860 tips of all branches.
861</p>
862</dd>
863<dt class="hdlist1">
Junio C Hamano0e066b92009-08-28 01:08:41864--recursive
865</dt>
Junio C Hamanoed69a742010-12-01 03:09:23866<dt class="hdlist1">
867--recurse-submodules
868</dt>
Junio C Hamano0e066b92009-08-28 01:08:41869<dd>
870<p>
871 After the clone is created, initialize all submodules within,
872 using their default settings. This is equivalent to running
Junio C Hamano621e1232009-10-26 05:16:47873 <tt>git submodule update --init --recursive</tt> immediately after
Junio C Hamano0e066b92009-08-28 01:08:41874 the clone is finished. This option is ignored if the cloned
875 repository does not have a worktree/checkout (i.e. if any of
876 <tt>--no-checkout</tt>/<tt>-n</tt>, <tt>--bare</tt>, or <tt>--mirror</tt> is given)
877</p>
878</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59879<dt class="hdlist1">
Junio C Hamanoa03ac862011-04-02 04:32:29880--separate-git-dir=&lt;git dir&gt;
881</dt>
882<dd>
883<p>
884 Instead of placing the cloned repository where it is supposed
885 to be, place the cloned repository at the specified directory,
886 then make a filesytem-agnostic git symbolic link to there.
887 The result is git repository can be separated from working
888 tree.
889</p>
890</dd>
891<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23892&lt;repository&gt;
893</dt>
894<dd>
895<p>
Junio C Hamano330aae62007-07-06 17:01:58896 The (possibly remote) repository to clone from. See the
897 <a href="#URLS">URLS</a> section below for more information on specifying
898 repositories.
Junio C Hamano1a4e8412005-12-27 08:17:23899</p>
900</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59901<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23902&lt;directory&gt;
903</dt>
904<dd>
905<p>
906 The name of a new directory to clone into. The "humanish"
907 part of the source repository is used if no directory is
Junio C Hamano621e1232009-10-26 05:16:47908 explicitly given (<tt>repo</tt> for <tt>/path/to/repo.git</tt> and <tt>foo</tt>
909 for <tt>host.xz:foo/.git</tt>). Cloning into an existing directory
Junio C Hamano89bdb3b2009-05-10 06:48:14910 is only allowed if the directory is empty.
Junio C Hamano1a4e8412005-12-27 08:17:23911</p>
912</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31913</dl></div>
Junio C Hamano1bb569e2006-05-05 23:14:25914</div>
Junio C Hamanoba4b9282008-07-06 05:20:31915<h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2>
Junio C Hamano330aae62007-07-06 17:01:58916<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59917<div class="paragraph"><p>In general, URLs contain information about the transport protocol, the
Junio C Hamano0c053e82010-04-19 06:46:34918address of the remote server, and the path to the repository.
919Depending on the transport protocol, some of this information may be
920absent.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59921<div class="paragraph"><p>Git natively supports ssh, git, http, https, ftp, ftps, and rsync
Junio C Hamano0c053e82010-04-19 06:46:34922protocols. The following syntaxes may be used with them:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59923<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:58924<li>
925<p>
Junio C Hamano0c053e82010-04-19 06:46:34926ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:58927</p>
928</li>
929<li>
930<p>
Junio C Hamanoa3bb6eb2009-02-05 01:26:33931git://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:58932</p>
933</li>
934<li>
935<p>
Junio C Hamano0c053e82010-04-19 06:46:34936http&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:58937</p>
938</li>
939<li>
940<p>
Junio C Hamano0c053e82010-04-19 06:46:34941ftp&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
Junio C Hamanodbb64592007-09-01 11:17:39942</p>
943</li>
944<li>
945<p>
Junio C Hamano0c053e82010-04-19 06:46:34946rsync://host.xz/path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:58947</p>
948</li>
Junio C Hamanoba4b9282008-07-06 05:20:31949</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:59950<div class="paragraph"><p>An alternative scp-like syntax may also be used with the ssh protocol:</p></div>
951<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:58952<li>
953<p>
Junio C Hamano0c053e82010-04-19 06:46:34954&#91;user@&#93;host.xz:path/to/repo.git/
Junio C Hamano330aae62007-07-06 17:01:58955</p>
956</li>
Junio C Hamanoba4b9282008-07-06 05:20:31957</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:59958<div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
959<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:34960<li>
961<p>
962ssh://&#91;user@&#93;host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
963</p>
964</li>
965<li>
966<p>
967git://host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
968</p>
969</li>
970<li>
971<p>
972&#91;user@&#93;host.xz:/~&#91;user&#93;/path/to/repo.git/
973</p>
974</li>
975</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:59976<div class="paragraph"><p>For local repositories, also supported by git natively, the following
Junio C Hamano0c053e82010-04-19 06:46:34977syntaxes may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59978<div class="ulist"><ul>
Junio C Hamano330aae62007-07-06 17:01:58979<li>
980<p>
981/path/to/repo.git/
982</p>
983</li>
Junio C Hamanob1d6e882007-08-11 08:30:16984<li>
985<p>
Junio C Hamano68cf15a2010-11-06 01:01:59986<a href="file:///path/to/repo.git/">file:///path/to/repo.git/</a>
Junio C Hamanob1d6e882007-08-11 08:30:16987</p>
988</li>
Junio C Hamanoba4b9282008-07-06 05:20:31989</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:59990<div class="paragraph"><p>These two syntaxes are mostly equivalent, except the former implies
Junio C Hamano0c053e82010-04-19 06:46:34991--local option.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59992<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:34993attempts to use the <em>remote-&lt;transport&gt;</em> remote helper, if one
994exists. To explicitly request a remote helper, the following syntax
995may be used:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59996<div class="ulist"><ul>
Junio C Hamano0c053e82010-04-19 06:46:34997<li>
998<p>
999&lt;transport&gt;::&lt;address&gt;
1000</p>
1001</li>
1002</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591003<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:341004URL-like string recognized by the specific remote helper being
1005invoked. See <a href="git-remote-helpers.html">git-remote-helpers(1)</a> for details.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591006<div class="paragraph"><p>If there are a large number of similarly-named remote repositories and
Junio C Hamano24bc09a2008-02-28 00:27:441007you want to use a different format for them (such that the URLs you
1008use will be rewritten into URLs that work), you can create a
Junio C Hamanoba4b9282008-07-06 05:20:311009configuration section of the form:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441010<div class="listingblock">
1011<div class="content">
1012<pre><tt> [url "&lt;actual url base&gt;"]
1013 insteadOf = &lt;other url base&gt;</tt></pre>
1014</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591015<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:441016<div class="listingblock">
1017<div class="content">
1018<pre><tt> [url "git://git.host.xz/"]
1019 insteadOf = host.xz:/path/to/
1020 insteadOf = work:</tt></pre>
1021</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591022<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:311023rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591024<div class="paragraph"><p>If you want to rewrite URLs for push only, you can create a
Junio C Hamano7df6dcf2009-09-13 09:51:171025configuration section of the form:</p></div>
1026<div class="listingblock">
1027<div class="content">
1028<pre><tt> [url "&lt;actual url base&gt;"]
1029 pushInsteadOf = &lt;other url base&gt;</tt></pre>
1030</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591031<div class="paragraph"><p>For example, with this:</p></div>
Junio C Hamano7df6dcf2009-09-13 09:51:171032<div class="listingblock">
1033<div class="content">
1034<pre><tt> [url "ssh://example.org/"]
1035 pushInsteadOf = git://example.org/</tt></pre>
1036</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591037<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:171038"ssh://example.org/path/to/repo.git" for pushes, but pulls will still
1039use the original URL.</p></div>
Junio C Hamano330aae62007-07-06 17:01:581040</div>
Junio C Hamanoba4b9282008-07-06 05:20:311041<h2 id="_examples">Examples</h2>
Junio C Hamano1bb569e2006-05-05 23:14:251042<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591043<div class="ulist"><ul>
Junio C Hamano9ccf6642010-03-22 01:47:351044<li>
1045<p>
1046Clone from upstream:
1047</p>
Junio C Hamano1a4e8412005-12-27 08:17:231048<div class="listingblock">
1049<div class="content">
1050<pre><tt>$ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
1051$ cd my2.6
1052$ make</tt></pre>
1053</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351054</li>
1055<li>
1056<p>
1057Make a local clone that borrows from the current directory, without checking things out:
1058</p>
Junio C Hamano1a4e8412005-12-27 08:17:231059<div class="listingblock">
1060<div class="content">
1061<pre><tt>$ git clone -l -s -n . ../copy
Junio C Hamano8638c922007-05-12 20:50:081062$ cd ../copy
Junio C Hamano1a4e8412005-12-27 08:17:231063$ git show-branch</tt></pre>
1064</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351065</li>
1066<li>
1067<p>
1068Clone from upstream while borrowing from an existing local directory:
1069</p>
Junio C Hamanof50bfec2006-04-19 09:44:121070<div class="listingblock">
1071<div class="content">
1072<pre><tt>$ git clone --reference my2.6 \
1073 git://git.kernel.org/pub/scm/.../linux-2.7 \
1074 my2.7
1075$ cd my2.7</tt></pre>
1076</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351077</li>
1078<li>
1079<p>
1080Create a bare repository to publish your changes to the public:
1081</p>
Junio C Hamano38064d52006-01-15 10:13:491082<div class="listingblock">
1083<div class="content">
Junio C Hamanoe663a7a2006-01-25 12:37:281084<pre><tt>$ git clone --bare -l /home/proj/.git /pub/scm/proj.git</tt></pre>
Junio C Hamano38064d52006-01-15 10:13:491085</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351086</li>
1087<li>
1088<p>
1089Create a repository on the kernel.org machine that borrows from Linus:
1090</p>
Junio C Hamano38064d52006-01-15 10:13:491091<div class="listingblock">
1092<div class="content">
Junio C Hamanoe663a7a2006-01-25 12:37:281093<pre><tt>$ git clone --bare -l -s /pub/scm/.../torvalds/linux-2.6.git \
Junio C Hamano38064d52006-01-15 10:13:491094 /pub/scm/.../me/subsys-2.6.git</tt></pre>
1095</div></div>
Junio C Hamano9ccf6642010-03-22 01:47:351096</li>
1097</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:231098</div>
Junio C Hamanoba4b9282008-07-06 05:20:311099<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231100<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591101<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231102</div>
Junio C Hamano7bd050f2011-09-22 06:32:221103</div>
1104<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:231105<div id="footer">
1106<div id="footer-text">
Junio C Hamanob5be0522012-01-29 22:20:191107Last updated 2012-01-29 14:19:30 PDT
Junio C Hamano1a4e8412005-12-27 08:17:231108</div>
1109</div>
1110</body>
1111</html>