Autogenerated HTML docs for v1.7.4-rc2
[git/jnareb-git.git] / git-clone.html
blob08291afd00da7a59caab6ee9a3e88fd6c56b8925
1 <!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" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>git-clone(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, 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;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#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;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-clone(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-clone -
411 Clone a repository into a new directory
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="verseblock">
418 <div class="verseblock-content"><em>git clone</em> [--template=&lt;template_directory&gt;]
419 [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
420 [-o &lt;name&gt;] [-b &lt;name&gt;] [-u &lt;upload-pack&gt;] [--reference &lt;repository&gt;]
421 [--depth &lt;depth&gt;] [--recursive|--recurse-submodules] [--] &lt;repository&gt;
422 [&lt;directory&gt;]</div>
423 <div class="verseblock-attribution">
424 </div></div>
425 </div>
426 <h2 id="_description">DESCRIPTION</h2>
427 <div class="sectionbody">
428 <div class="paragraph"><p>Clones a repository into a newly created directory, creates
429 remote-tracking branches for each branch in the cloned repository
430 (visible using <tt>git branch -r</tt>), and creates and checks out an
431 initial branch that is forked from the cloned repository&#8217;s
432 currently active branch.</p></div>
433 <div class="paragraph"><p>After the clone, a plain <tt>git fetch</tt> without arguments will update
434 all the remote-tracking branches, and a <tt>git pull</tt> without
435 arguments will in addition merge the remote master branch into the
436 current master branch, if any.</p></div>
437 <div class="paragraph"><p>This default configuration is achieved by creating references to
438 the remote branch heads under <tt>refs/remotes/origin</tt> and
439 by initializing <tt>remote.origin.url</tt> and <tt>remote.origin.fetch</tt>
440 configuration variables.</p></div>
441 </div>
442 <h2 id="_options">OPTIONS</h2>
443 <div class="sectionbody">
444 <div class="dlist"><dl>
445 <dt class="hdlist1">
446 --local
447 </dt>
448 <dt class="hdlist1">
450 </dt>
451 <dd>
453 When the repository to clone from is on a local machine,
454 this flag bypasses the normal "git aware" transport
455 mechanism and clones the repository by making a copy of
456 HEAD and everything under objects and refs directories.
457 The files under <tt>.git/objects/</tt> directory are hardlinked
458 to save space when possible. This is now the default when
459 the source repository is specified with <tt>/path/to/repo</tt>
460 syntax, so it essentially is a no-op option. To force
461 copying instead of hardlinking (which may be desirable
462 if you are trying to make a back-up of your repository),
463 but still avoid the usual "git aware" transport
464 mechanism, <tt>--no-hardlinks</tt> can be used.
465 </p>
466 </dd>
467 <dt class="hdlist1">
468 --no-hardlinks
469 </dt>
470 <dd>
472 Optimize the cloning process from a repository on a
473 local filesystem by copying files under <tt>.git/objects</tt>
474 directory.
475 </p>
476 </dd>
477 <dt class="hdlist1">
478 --shared
479 </dt>
480 <dt class="hdlist1">
482 </dt>
483 <dd>
485 When the repository to clone is on the local machine,
486 instead of using hard links, automatically setup
487 <tt>.git/objects/info/alternates</tt> to share the objects
488 with the source repository. The resulting repository
489 starts out without any object of its own.
490 </p>
491 <div class="paragraph"><p><strong>NOTE</strong>: this is a possibly dangerous operation; do <strong>not</strong> use
492 it unless you understand what it does. If you clone your
493 repository using this option and then delete branches (or use any
494 other git command that makes any existing commit unreferenced) in the
495 source repository, some objects may become unreferenced (or dangling).
496 These objects may be removed by normal git operations (such as <tt>git commit</tt>)
497 which automatically call <tt>git gc --auto</tt>. (See <a href="git-gc.html">git-gc(1)</a>.)
498 If these objects are removed and were referenced by the cloned repository,
499 then the cloned repository will become corrupt.</p></div>
500 <div class="paragraph"><p>Note that running <tt>git repack</tt> without the <tt>-l</tt> option in a repository
501 cloned with <tt>-s</tt> will copy objects from the source repository into a pack
502 in the cloned repository, removing the disk space savings of <tt>clone -s</tt>.
503 It is safe, however, to run <tt>git gc</tt>, which uses the <tt>-l</tt> option by
504 default.</p></div>
505 <div class="paragraph"><p>If you want to break the dependency of a repository cloned with <tt>-s</tt> on
506 its source repository, you can simply run <tt>git repack -a</tt> to copy all
507 objects from the source repository into a pack in the cloned repository.</p></div>
508 </dd>
509 <dt class="hdlist1">
510 --reference &lt;repository&gt;
511 </dt>
512 <dd>
514 If the reference repository is on the local machine,
515 automatically setup <tt>.git/objects/info/alternates</tt> to
516 obtain objects from the reference repository. Using
517 an already existing repository as an alternate will
518 require fewer objects to be copied from the repository
519 being cloned, reducing network and local storage costs.
520 </p>
521 <div class="paragraph"><p><strong>NOTE</strong>: see the NOTE for the <tt>--shared</tt> option.</p></div>
522 </dd>
523 <dt class="hdlist1">
524 --quiet
525 </dt>
526 <dt class="hdlist1">
528 </dt>
529 <dd>
531 Operate quietly. Progress is not reported to the standard
532 error stream. This flag is also passed to the &#8216;rsync&#8217;
533 command when given.
534 </p>
535 </dd>
536 <dt class="hdlist1">
537 --verbose
538 </dt>
539 <dt class="hdlist1">
541 </dt>
542 <dd>
544 Run verbosely. Does not affect the reporting of progress status
545 to the standard error stream.
546 </p>
547 </dd>
548 <dt class="hdlist1">
549 --progress
550 </dt>
551 <dd>
553 Progress status is reported on the standard error stream
554 by default when it is attached to a terminal, unless -q
555 is specified. This flag forces progress status even if the
556 standard error stream is not directed to a terminal.
557 </p>
558 </dd>
559 <dt class="hdlist1">
560 --no-checkout
561 </dt>
562 <dt class="hdlist1">
564 </dt>
565 <dd>
567 No checkout of HEAD is performed after the clone is complete.
568 </p>
569 </dd>
570 <dt class="hdlist1">
571 --bare
572 </dt>
573 <dd>
575 Make a <em>bare</em> GIT repository. That is, instead of
576 creating <tt>&lt;directory&gt;</tt> and placing the administrative
577 files in <tt>&lt;directory&gt;/.git</tt>, make the <tt>&lt;directory&gt;</tt>
578 itself the <tt>$GIT_DIR</tt>. This obviously implies the <tt>-n</tt>
579 because there is nowhere to check out the working tree.
580 Also the branch heads at the remote are copied directly
581 to corresponding local branch heads, without mapping
582 them to <tt>refs/remotes/origin/</tt>. When this option is
583 used, neither remote-tracking branches nor the related
584 configuration variables are created.
585 </p>
586 </dd>
587 <dt class="hdlist1">
588 --mirror
589 </dt>
590 <dd>
592 Set up a mirror of the source repository. This implies <tt>--bare</tt>.
593 Compared to <tt>--bare</tt>, <tt>--mirror</tt> not only maps local branches of the
594 source to local branches of the target, it maps all refs (including
595 remote-tracking branches, notes etc.) and sets up a refspec configuration such
596 that all these refs are overwritten by a <tt>git remote update</tt> in the
597 target repository.
598 </p>
599 </dd>
600 <dt class="hdlist1">
601 --origin &lt;name&gt;
602 </dt>
603 <dt class="hdlist1">
604 -o &lt;name&gt;
605 </dt>
606 <dd>
608 Instead of using the remote name <tt>origin</tt> to keep track
609 of the upstream repository, use <tt>&lt;name&gt;</tt>.
610 </p>
611 </dd>
612 <dt class="hdlist1">
613 --branch &lt;name&gt;
614 </dt>
615 <dt class="hdlist1">
616 -b &lt;name&gt;
617 </dt>
618 <dd>
620 Instead of pointing the newly created HEAD to the branch pointed
621 to by the cloned repository&#8217;s HEAD, point to <tt>&lt;name&gt;</tt> branch
622 instead. In a non-bare repository, this is the branch that will
623 be checked out.
624 </p>
625 </dd>
626 <dt class="hdlist1">
627 --upload-pack &lt;upload-pack&gt;
628 </dt>
629 <dt class="hdlist1">
630 -u &lt;upload-pack&gt;
631 </dt>
632 <dd>
634 When given, and the repository to clone from is accessed
635 via ssh, this specifies a non-default path for the command
636 run on the other end.
637 </p>
638 </dd>
639 <dt class="hdlist1">
640 --template=&lt;template_directory&gt;
641 </dt>
642 <dd>
644 Specify the directory from which templates will be used;
645 (See the "TEMPLATE DIRECTORY" section of <a href="git-init.html">git-init(1)</a>.)
646 </p>
647 </dd>
648 <dt class="hdlist1">
649 --depth &lt;depth&gt;
650 </dt>
651 <dd>
653 Create a <em>shallow</em> clone with a history truncated to the
654 specified number of revisions. A shallow repository has a
655 number of limitations (you cannot clone or fetch from
656 it, nor push from nor into it), but is adequate if you
657 are only interested in the recent history of a large project
658 with a long history, and would want to send in fixes
659 as patches.
660 </p>
661 </dd>
662 <dt class="hdlist1">
663 --recursive
664 </dt>
665 <dt class="hdlist1">
666 --recurse-submodules
667 </dt>
668 <dd>
670 After the clone is created, initialize all submodules within,
671 using their default settings. This is equivalent to running
672 <tt>git submodule update --init --recursive</tt> immediately after
673 the clone is finished. This option is ignored if the cloned
674 repository does not have a worktree/checkout (i.e. if any of
675 <tt>--no-checkout</tt>/<tt>-n</tt>, <tt>--bare</tt>, or <tt>--mirror</tt> is given)
676 </p>
677 </dd>
678 <dt class="hdlist1">
679 &lt;repository&gt;
680 </dt>
681 <dd>
683 The (possibly remote) repository to clone from. See the
684 <a href="#URLS">URLS</a> section below for more information on specifying
685 repositories.
686 </p>
687 </dd>
688 <dt class="hdlist1">
689 &lt;directory&gt;
690 </dt>
691 <dd>
693 The name of a new directory to clone into. The "humanish"
694 part of the source repository is used if no directory is
695 explicitly given (<tt>repo</tt> for <tt>/path/to/repo.git</tt> and <tt>foo</tt>
696 for <tt>host.xz:foo/.git</tt>). Cloning into an existing directory
697 is only allowed if the directory is empty.
698 </p>
699 </dd>
700 </dl></div>
701 </div>
702 <h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2>
703 <div class="sectionbody">
704 <div class="paragraph"><p>In general, URLs contain information about the transport protocol, the
705 address of the remote server, and the path to the repository.
706 Depending on the transport protocol, some of this information may be
707 absent.</p></div>
708 <div class="paragraph"><p>Git natively supports ssh, git, http, https, ftp, ftps, and rsync
709 protocols. The following syntaxes may be used with them:</p></div>
710 <div class="ulist"><ul>
711 <li>
713 ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
714 </p>
715 </li>
716 <li>
718 git://host.xz&#91;:port&#93;/path/to/repo.git/
719 </p>
720 </li>
721 <li>
723 http&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
724 </p>
725 </li>
726 <li>
728 ftp&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
729 </p>
730 </li>
731 <li>
733 rsync://host.xz/path/to/repo.git/
734 </p>
735 </li>
736 </ul></div>
737 <div class="paragraph"><p>An alternative scp-like syntax may also be used with the ssh protocol:</p></div>
738 <div class="ulist"><ul>
739 <li>
741 &#91;user@&#93;host.xz:path/to/repo.git/
742 </p>
743 </li>
744 </ul></div>
745 <div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
746 <div class="ulist"><ul>
747 <li>
749 ssh://&#91;user@&#93;host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
750 </p>
751 </li>
752 <li>
754 git://host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
755 </p>
756 </li>
757 <li>
759 &#91;user@&#93;host.xz:/~&#91;user&#93;/path/to/repo.git/
760 </p>
761 </li>
762 </ul></div>
763 <div class="paragraph"><p>For local repositories, also supported by git natively, the following
764 syntaxes may be used:</p></div>
765 <div class="ulist"><ul>
766 <li>
768 /path/to/repo.git/
769 </p>
770 </li>
771 <li>
773 <a href="file:///path/to/repo.git/">file:///path/to/repo.git/</a>
774 </p>
775 </li>
776 </ul></div>
777 <div class="paragraph"><p>These two syntaxes are mostly equivalent, except the former implies
778 --local option.</p></div>
779 <div class="paragraph"><p>When git doesn&#8217;t know how to handle a certain transport protocol, it
780 attempts to use the <em>remote-&lt;transport&gt;</em> remote helper, if one
781 exists. To explicitly request a remote helper, the following syntax
782 may be used:</p></div>
783 <div class="ulist"><ul>
784 <li>
786 &lt;transport&gt;::&lt;address&gt;
787 </p>
788 </li>
789 </ul></div>
790 <div class="paragraph"><p>where &lt;address&gt; may be a path, a server and path, or an arbitrary
791 URL-like string recognized by the specific remote helper being
792 invoked. See <a href="git-remote-helpers.html">git-remote-helpers(1)</a> for details.</p></div>
793 <div class="paragraph"><p>If there are a large number of similarly-named remote repositories and
794 you want to use a different format for them (such that the URLs you
795 use will be rewritten into URLs that work), you can create a
796 configuration section of the form:</p></div>
797 <div class="listingblock">
798 <div class="content">
799 <pre><tt> [url "&lt;actual url base&gt;"]
800 insteadOf = &lt;other url base&gt;</tt></pre>
801 </div></div>
802 <div class="paragraph"><p>For example, with this:</p></div>
803 <div class="listingblock">
804 <div class="content">
805 <pre><tt> [url "git://git.host.xz/"]
806 insteadOf = host.xz:/path/to/
807 insteadOf = work:</tt></pre>
808 </div></div>
809 <div class="paragraph"><p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
810 rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
811 <div class="paragraph"><p>If you want to rewrite URLs for push only, you can create a
812 configuration section of the form:</p></div>
813 <div class="listingblock">
814 <div class="content">
815 <pre><tt> [url "&lt;actual url base&gt;"]
816 pushInsteadOf = &lt;other url base&gt;</tt></pre>
817 </div></div>
818 <div class="paragraph"><p>For example, with this:</p></div>
819 <div class="listingblock">
820 <div class="content">
821 <pre><tt> [url "ssh://example.org/"]
822 pushInsteadOf = git://example.org/</tt></pre>
823 </div></div>
824 <div class="paragraph"><p>a URL like "git://example.org/path/to/repo.git" will be rewritten to
825 "ssh://example.org/path/to/repo.git" for pushes, but pulls will still
826 use the original URL.</p></div>
827 </div>
828 <h2 id="_examples">Examples</h2>
829 <div class="sectionbody">
830 <div class="ulist"><ul>
831 <li>
833 Clone from upstream:
834 </p>
835 <div class="listingblock">
836 <div class="content">
837 <pre><tt>$ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
838 $ cd my2.6
839 $ make</tt></pre>
840 </div></div>
841 </li>
842 <li>
844 Make a local clone that borrows from the current directory, without checking things out:
845 </p>
846 <div class="listingblock">
847 <div class="content">
848 <pre><tt>$ git clone -l -s -n . ../copy
849 $ cd ../copy
850 $ git show-branch</tt></pre>
851 </div></div>
852 </li>
853 <li>
855 Clone from upstream while borrowing from an existing local directory:
856 </p>
857 <div class="listingblock">
858 <div class="content">
859 <pre><tt>$ git clone --reference my2.6 \
860 git://git.kernel.org/pub/scm/.../linux-2.7 \
861 my2.7
862 $ cd my2.7</tt></pre>
863 </div></div>
864 </li>
865 <li>
867 Create a bare repository to publish your changes to the public:
868 </p>
869 <div class="listingblock">
870 <div class="content">
871 <pre><tt>$ git clone --bare -l /home/proj/.git /pub/scm/proj.git</tt></pre>
872 </div></div>
873 </li>
874 <li>
876 Create a repository on the kernel.org machine that borrows from Linus:
877 </p>
878 <div class="listingblock">
879 <div class="content">
880 <pre><tt>$ git clone --bare -l -s /pub/scm/.../torvalds/linux-2.6.git \
881 /pub/scm/.../me/subsys-2.6.git</tt></pre>
882 </div></div>
883 </li>
884 </ul></div>
885 </div>
886 <h2 id="_author">Author</h2>
887 <div class="sectionbody">
888 <div class="paragraph"><p>Written by Linus Torvalds &lt;<a href="mailto:torvalds@osdl.org">torvalds@osdl.org</a>&gt;</p></div>
889 </div>
890 <h2 id="_documentation">Documentation</h2>
891 <div class="sectionbody">
892 <div class="paragraph"><p>Documentation by Junio C Hamano and the git-list &lt;<a href="mailto:git@vger.kernel.org">git@vger.kernel.org</a>&gt;.</p></div>
893 </div>
894 <h2 id="_git">GIT</h2>
895 <div class="sectionbody">
896 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
897 </div>
898 <div id="footer">
899 <div id="footer-text">
900 Last updated 2010-12-01 03:09:03 UTC
901 </div>
902 </div>
903 </body>
904 </html>