blob: 4b8ba1d747c3214269f1129f5970b235ffd573fd [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 Hamanoba4b9282008-07-06 05:20:316<meta name="generator" content="AsciiDoc 8.2.5" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
Junio C Hamanoba4b9282008-07-06 05:20:3119a {
20 color: blue;
21 text-decoration: underline;
22}
23a:visited {
24 color: fuchsia;
25}
Junio C Hamano1a4e8412005-12-27 08:17:2326
27em {
28 font-style: italic;
29}
30
31strong {
32 font-weight: bold;
33}
34
35tt {
36 color: navy;
37}
38
39h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
45}
46
Junio C Hamanoba4b9282008-07-06 05:20:3147h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2348 border-bottom: 2px solid silver;
49}
50h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 padding-top: 0.5em;
52}
Junio C Hamanoba4b9282008-07-06 05:20:3153h3 {
54 float: left;
55}
56h3 + * {
57 clear: left;
58}
Junio C Hamano1a4e8412005-12-27 08:17:2359
60div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
63}
64
65hr {
66 border: 1px solid silver;
67}
68
69p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
72}
73
74pre {
75 padding: 0;
76 margin: 0;
77}
78
79span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3183 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2384}
85span#email {
86}
87span#revision {
88 font-family: sans-serif;
89}
90
91div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
97}
98div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
101}
102div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
105}
106
107div#preamble,
108div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
114}
115div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
118}
119
120div.content { /* Block element content. */
121 padding: 0;
122}
123
124/* Block element titles. */
125div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
131}
132div.title + * {
133 margin-top: 0;
134}
135
136td div.title:first-child {
137 margin-top: 0.0em;
138}
139div.content div.title:first-child {
140 margin-top: 0.0em;
141}
142div.content + div.title {
143 margin-top: 0.0em;
144}
145
146div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
150}
151
Junio C Hamanoba4b9282008-07-06 05:20:31152div.listingblock {
153 margin-right: 0%;
154}
Junio C Hamano1a4e8412005-12-27 08:17:23155div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
159}
160
161div.quoteblock > div.content {
162 padding-left: 2.0em;
163}
Junio C Hamanoba4b9282008-07-06 05:20:31164
165div.attribution {
Junio C Hamano1a4e8412005-12-27 08:17:23166 text-align: right;
167}
Junio C Hamanoba4b9282008-07-06 05:20:31168div.verseblock + div.attribution {
169 text-align: left;
170}
Junio C Hamano1a4e8412005-12-27 08:17:23171
172div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
179}
180div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
183}
184
185div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
188}
189
190div.verseblock div.content {
191 white-space: pre;
192}
193
194div.imageblock div.content { padding-left: 0; }
195div.imageblock img { border: 1px solid silver; }
196span.image img { border-style: none; }
197
198dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
201}
202dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
206}
207dd > *:first-child {
208 margin-top: 0;
209}
210
211ul, ol {
212 list-style-position: outside;
213}
Junio C Hamanoba4b9282008-07-06 05:20:31214div.olist2 ol {
Junio C Hamano1a4e8412005-12-27 08:17:23215 list-style-type: lower-alpha;
216}
217
218div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31219 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221thead {
222 font-family: sans-serif;
223 font-weight: bold;
224}
225tfoot {
226 font-weight: bold;
227}
228
229div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
Junio C Hamanoba4b9282008-07-06 05:20:31233div.hlist td {
234 padding-bottom: 5px;
235}
Junio C Hamano1a4e8412005-12-27 08:17:23236td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
240}
241td.hlist2 {
242 vertical-align: top;
243}
244
245@media print {
246 div#footer-badges { display: none; }
247}
Junio C Hamanoba4b9282008-07-06 05:20:31248
249div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
256}
257
258div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
261}
262div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
265}
266div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
269}
270div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
273}
274include1::./stylesheets/xhtml11-manpage.css[]
Junio C Hamano1a4e8412005-12-27 08:17:23275/* Workarounds for IE6's broken and incomplete CSS2. */
276
277div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
281}
282div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
287}
288
289div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
293}
294
295div.quoteblock-content {
296 padding-left: 2.0em;
297}
298
299div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
302}
Junio C Hamanoba4b9282008-07-06 05:20:31303
304/* IE6 sets dynamically generated links as visited. */
305div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23306</style>
307<title>git-clone(1)</title>
308</head>
309<body>
310<div id="header">
311<h1>
312git-clone(1) Manual Page
313</h1>
314<h2>NAME</h2>
315<div class="sectionbody">
316<p>git-clone -
Junio C Hamano4ec06712007-06-09 20:39:33317 Clone a repository into a new directory
Junio C Hamano1a4e8412005-12-27 08:17:23318</p>
319</div>
320</div>
321<h2>SYNOPSIS</h2>
322<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58323<div class="verseblock">
Junio C Hamanofce7c7e2008-07-02 03:06:38324<div class="content"><em>git clone</em> [--template=&lt;template_directory&gt;]
Junio C Hamanob1d6e882007-08-11 08:30:16325 [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare]
Junio C Hamanof31d9f52006-05-28 20:58:09326 [-o &lt;name&gt;] [-u &lt;upload-pack&gt;] [--reference &lt;repository&gt;]
Junio C Hamanod814b6d2007-11-04 11:13:49327 [--depth &lt;depth&gt;] [--] &lt;repository&gt; [&lt;directory&gt;]</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23328</div>
Junio C Hamanoba4b9282008-07-06 05:20:31329<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23330<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31331<div class="para"><p>Clones a repository into a newly created directory, creates
Junio C Hamano5102d9a2006-12-08 07:23:46332remote-tracking branches for each branch in the cloned repository
Junio C Hamano79770b62007-01-07 07:43:58333(visible using <tt>git branch -r</tt>), and creates and checks out an initial
Junio C Hamanoba4b9282008-07-06 05:20:31334branch equal to the cloned repository's currently active branch.</p></div>
335<div class="para"><p>After the clone, a plain <tt>git fetch</tt> without arguments will update
Junio C Hamano5102d9a2006-12-08 07:23:46336all the remote-tracking branches, and a <tt>git pull</tt> without
337arguments will in addition merge the remote master branch into the
Junio C Hamanoba4b9282008-07-06 05:20:31338current master branch, if any.</p></div>
339<div class="para"><p>This default configuration is achieved by creating references to
Junio C Hamano5102d9a2006-12-08 07:23:46340the remote branch heads under <tt>$GIT_DIR/refs/remotes/origin</tt> and
341by initializing <tt>remote.origin.url</tt> and <tt>remote.origin.fetch</tt>
Junio C Hamanoba4b9282008-07-06 05:20:31342configuration variables.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23343</div>
Junio C Hamanoba4b9282008-07-06 05:20:31344<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23345<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31346<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23347<dt>
348--local
349</dt>
350<dt>
351-l
352</dt>
353<dd>
354<p>
355 When the repository to clone from is on a local machine,
356 this flag bypasses normal "git aware" transport
357 mechanism and clones the repository by making a copy of
358 HEAD and everything under objects and refs directories.
Junio C Hamanob1d6e882007-08-11 08:30:16359 The files under <tt>.git/objects/</tt> directory are hardlinked
360 to save space when possible. This is now the default when
361 the source repository is specified with <tt>/path/to/repo</tt>
362 syntax, so it essentially is a no-op option. To force
363 copying instead of hardlinking (which may be desirable
364 if you are trying to make a back-up of your repository),
365 but still avoid the usual "git aware" transport
366 mechanism, <tt>--no-hardlinks</tt> can be used.
367</p>
368</dd>
369<dt>
370--no-hardlinks
371</dt>
372<dd>
373<p>
374 Optimize the cloning process from a repository on a
375 local filesystem by copying files under <tt>.git/objects</tt>
376 directory.
Junio C Hamano1a4e8412005-12-27 08:17:23377</p>
378</dd>
379<dt>
380--shared
381</dt>
382<dt>
383-s
384</dt>
385<dd>
386<p>
387 When the repository to clone is on the local machine,
388 instead of using hard links, automatically setup
Junio C Hamanof50bfec2006-04-19 09:44:12389 .git/objects/info/alternates to share the objects
Junio C Hamano1a4e8412005-12-27 08:17:23390 with the source repository. The resulting repository
391 starts out without any object of its own.
392</p>
Junio C Hamanoba4b9282008-07-06 05:20:31393<div class="para"><p><strong>NOTE</strong>: this is a possibly dangerous operation; do <strong>not</strong> use
Junio C Hamanoefe3c632008-02-14 00:51:31394it unless you understand what it does. If you clone your
Junio C Hamanoa9aee782008-04-23 16:09:20395repository using this option and then delete branches (or use any
396other git command that makes any existing commit unreferenced) in the
397source repository, some objects may become unreferenced (or dangling).
Junio C Hamanoba4b9282008-07-06 05:20:31398These objects may be removed by normal git operations (such as <em>git-commit</em>)
Junio C Hamanofce7c7e2008-07-02 03:06:38399which automatically call <tt>git gc --auto</tt>. (See <a href="git-gc.html">git-gc(1)</a>.)
400If these objects are removed and were referenced by the cloned repository,
Junio C Hamanoba4b9282008-07-06 05:20:31401then the cloned repository will become corrupt.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23402</dd>
403<dt>
Junio C Hamanof50bfec2006-04-19 09:44:12404--reference &lt;repository&gt;
405</dt>
406<dd>
407<p>
408 If the reference repository is on the local machine
409 automatically setup .git/objects/info/alternates to
410 obtain objects from the reference repository. Using
411 an already existing repository as an alternate will
Junio C Hamano250f03e2007-09-10 01:33:28412 require fewer objects to be copied from the repository
Junio C Hamanof50bfec2006-04-19 09:44:12413 being cloned, reducing network and local storage costs.
414</p>
Junio C Hamanoba4b9282008-07-06 05:20:31415<div class="para"><p><strong>NOTE</strong>: see NOTE to --shared option.</p></div>
Junio C Hamanof50bfec2006-04-19 09:44:12416</dd>
417<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23418--quiet
419</dt>
420<dt>
421-q
422</dt>
423<dd>
424<p>
425 Operate quietly. This flag is passed to "rsync" and
Junio C Hamanoba4b9282008-07-06 05:20:31426 <em>git-fetch-pack</em> commands when given.
Junio C Hamano1a4e8412005-12-27 08:17:23427</p>
428</dd>
429<dt>
Junio C Hamano1e6e0062007-07-13 05:33:25430--no-checkout
431</dt>
432<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23433-n
434</dt>
435<dd>
436<p>
437 No checkout of HEAD is performed after the clone is complete.
438</p>
439</dd>
440<dt>
Junio C Hamanoe663a7a2006-01-25 12:37:28441--bare
Junio C Hamano38064d52006-01-15 10:13:49442</dt>
443<dd>
444<p>
Junio C Hamanoe663a7a2006-01-25 12:37:28445 Make a <em>bare</em> GIT repository. That is, instead of
Junio C Hamano38064d52006-01-15 10:13:49446 creating <tt>&lt;directory&gt;</tt> and placing the administrative
447 files in <tt>&lt;directory&gt;/.git</tt>, make the <tt>&lt;directory&gt;</tt>
Junio C Hamano9f292e72006-11-24 11:37:29448 itself the <tt>$GIT_DIR</tt>. This obviously implies the <tt>-n</tt>
449 because there is nowhere to check out the working tree.
450 Also the branch heads at the remote are copied directly
451 to corresponding local branch heads, without mapping
452 them to <tt>refs/remotes/origin/</tt>. When this option is
Junio C Hamanod3361ad2007-01-01 03:20:24453 used, neither remote-tracking branches nor the related
454 configuration variables are created.
Junio C Hamano38064d52006-01-15 10:13:49455</p>
456</dd>
457<dt>
Junio C Hamanodcc22ee2006-11-03 02:40:13458--origin &lt;name&gt;
459</dt>
460<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23461-o &lt;name&gt;
462</dt>
463<dd>
464<p>
Junio C Hamanod3361ad2007-01-01 03:20:24465 Instead of using the remote name <em>origin</em> to keep track
466 of the upstream repository, use &lt;name&gt; instead.
Junio C Hamano1a4e8412005-12-27 08:17:23467</p>
468</dd>
469<dt>
470--upload-pack &lt;upload-pack&gt;
471</dt>
472<dt>
473-u &lt;upload-pack&gt;
474</dt>
475<dd>
476<p>
477 When given, and the repository to clone from is handled
Junio C Hamanoba4b9282008-07-06 05:20:31478 by <em>git-fetch-pack</em>, <tt>--exec=&lt;upload-pack&gt;</tt> is passed to
Junio C Hamano1a4e8412005-12-27 08:17:23479 the command to specify non-default path for the command
480 run on the other end.
481</p>
482</dd>
483<dt>
Junio C Hamanof31d9f52006-05-28 20:58:09484--template=&lt;template_directory&gt;
485</dt>
486<dd>
487<p>
488 Specify the directory from which templates will be used;
489 if unset the templates are taken from the installation
490 defined default, typically <tt>/usr/share/git-core/templates</tt>.
491</p>
492</dd>
493<dt>
Junio C Hamano0bbd4672007-02-20 04:52:14494--depth &lt;depth&gt;
Junio C Hamanob288d9e2007-01-02 00:04:15495</dt>
496<dd>
497<p>
498 Create a <em>shallow</em> clone with a history truncated to the
Junio C Hamano1c708832007-11-02 02:47:50499 specified number of revisions. A shallow repository has a
Junio C Hamanob288d9e2007-01-02 00:04:15500 number of limitations (you cannot clone or fetch from
501 it, nor push from nor into it), but is adequate if you
Junio C Hamano1c708832007-11-02 02:47:50502 are only interested in the recent history of a large project
503 with a long history, and would want to send in fixes
Junio C Hamanob288d9e2007-01-02 00:04:15504 as patches.
505</p>
506</dd>
507<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23508&lt;repository&gt;
509</dt>
510<dd>
511<p>
Junio C Hamano330aae62007-07-06 17:01:58512 The (possibly remote) repository to clone from. See the
513 <a href="#URLS">URLS</a> section below for more information on specifying
514 repositories.
Junio C Hamano1a4e8412005-12-27 08:17:23515</p>
516</dd>
517<dt>
518&lt;directory&gt;
519</dt>
520<dd>
521<p>
522 The name of a new directory to clone into. The "humanish"
523 part of the source repository is used if no directory is
524 explicitly given ("repo" for "/path/to/repo.git" and "foo"
525 for "host.xz:foo/.git"). Cloning into an existing directory
526 is not allowed.
527</p>
528</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31529</dl></div>
Junio C Hamano1bb569e2006-05-05 23:14:25530</div>
Junio C Hamanoba4b9282008-07-06 05:20:31531<h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2>
Junio C Hamano330aae62007-07-06 17:01:58532<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31533<div class="para"><p>One of the following notations can be used
534to name the remote repository:</p></div>
Junio C Hamano330aae62007-07-06 17:01:58535<div class="exampleblock">
536<div class="exampleblock-content">
Junio C Hamanoba4b9282008-07-06 05:20:31537<div class="ilist"><ul>
Junio C Hamano330aae62007-07-06 17:01:58538<li>
539<p>
540rsync://host.xz/path/to/repo.git/
541</p>
542</li>
543<li>
544<p>
545http://host.xz/path/to/repo.git/
546</p>
547</li>
548<li>
549<p>
550https://host.xz/path/to/repo.git/
551</p>
552</li>
553<li>
554<p>
555git://host.xz/path/to/repo.git/
556</p>
557</li>
558<li>
559<p>
560git://host.xz/~user/path/to/repo.git/
561</p>
562</li>
563<li>
564<p>
Junio C Hamanodbb64592007-09-01 11:17:39565ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
566</p>
567</li>
568<li>
569<p>
Junio C Hamano330aae62007-07-06 17:01:58570ssh://&#91;user@&#93;host.xz/path/to/repo.git/
571</p>
572</li>
573<li>
574<p>
575ssh://&#91;user@&#93;host.xz/~user/path/to/repo.git/
576</p>
577</li>
578<li>
579<p>
580ssh://&#91;user@&#93;host.xz/~/path/to/repo.git
581</p>
582</li>
Junio C Hamanoba4b9282008-07-06 05:20:31583</ul></div>
Junio C Hamano330aae62007-07-06 17:01:58584</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31585<div class="para"><p>SSH is the default transport protocol over the network. You can
Junio C Hamanob1d6e882007-08-11 08:30:16586optionally specify which user to log-in as, and an alternate,
587scp-like syntax is also supported. Both syntaxes support
Junio C Hamanodbb64592007-09-01 11:17:39588username expansion, as does the native git protocol, but
589only the former supports port specification. The following
Junio C Hamanoba4b9282008-07-06 05:20:31590three are identical to the last three above, respectively:</p></div>
Junio C Hamano330aae62007-07-06 17:01:58591<div class="exampleblock">
592<div class="exampleblock-content">
Junio C Hamanoba4b9282008-07-06 05:20:31593<div class="ilist"><ul>
Junio C Hamano330aae62007-07-06 17:01:58594<li>
595<p>
596&#91;user@&#93;host.xz:/path/to/repo.git/
597</p>
598</li>
599<li>
600<p>
601&#91;user@&#93;host.xz:~user/path/to/repo.git/
602</p>
603</li>
604<li>
605<p>
606&#91;user@&#93;host.xz:path/to/repo.git
607</p>
608</li>
Junio C Hamanoba4b9282008-07-06 05:20:31609</ul></div>
Junio C Hamano330aae62007-07-06 17:01:58610</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31611<div class="para"><p>To sync with a local directory, you can use:</p></div>
Junio C Hamano330aae62007-07-06 17:01:58612<div class="exampleblock">
613<div class="exampleblock-content">
Junio C Hamanoba4b9282008-07-06 05:20:31614<div class="ilist"><ul>
Junio C Hamano330aae62007-07-06 17:01:58615<li>
616<p>
617/path/to/repo.git/
618</p>
619</li>
Junio C Hamanob1d6e882007-08-11 08:30:16620<li>
621<p>
622file:///path/to/repo.git/
623</p>
624</li>
Junio C Hamanoba4b9282008-07-06 05:20:31625</ul></div>
Junio C Hamano330aae62007-07-06 17:01:58626</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31627<div class="para"><p>They are equivalent, except the former implies --local option.</p></div>
628<div class="para"><p>If there are a large number of similarly-named remote repositories and
Junio C Hamano24bc09a2008-02-28 00:27:44629you want to use a different format for them (such that the URLs you
630use will be rewritten into URLs that work), you can create a
Junio C Hamanoba4b9282008-07-06 05:20:31631configuration section of the form:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:44632<div class="listingblock">
633<div class="content">
634<pre><tt> [url "&lt;actual url base&gt;"]
635 insteadOf = &lt;other url base&gt;</tt></pre>
636</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31637<div class="para"><p>For example, with this:</p></div>
Junio C Hamano24bc09a2008-02-28 00:27:44638<div class="listingblock">
639<div class="content">
640<pre><tt> [url "git://git.host.xz/"]
641 insteadOf = host.xz:/path/to/
642 insteadOf = work:</tt></pre>
643</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:31644<div class="para"><p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
645rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
Junio C Hamano330aae62007-07-06 17:01:58646</div>
Junio C Hamanoba4b9282008-07-06 05:20:31647<h2 id="_examples">Examples</h2>
Junio C Hamano1bb569e2006-05-05 23:14:25648<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31649<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23650<dt>
651Clone from upstream
652</dt>
653<dd>
654<div class="listingblock">
655<div class="content">
656<pre><tt>$ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
657$ cd my2.6
658$ make</tt></pre>
659</div></div>
660</dd>
661<dt>
662Make a local clone that borrows from the current directory, without checking things out
663</dt>
664<dd>
665<div class="listingblock">
666<div class="content">
667<pre><tt>$ git clone -l -s -n . ../copy
Junio C Hamano8638c922007-05-12 20:50:08668$ cd ../copy
Junio C Hamano1a4e8412005-12-27 08:17:23669$ git show-branch</tt></pre>
670</div></div>
671</dd>
Junio C Hamano38064d52006-01-15 10:13:49672<dt>
Junio C Hamanof50bfec2006-04-19 09:44:12673Clone from upstream while borrowing from an existing local directory
674</dt>
675<dd>
676<div class="listingblock">
677<div class="content">
678<pre><tt>$ git clone --reference my2.6 \
679 git://git.kernel.org/pub/scm/.../linux-2.7 \
680 my2.7
681$ cd my2.7</tt></pre>
682</div></div>
683</dd>
684<dt>
Junio C Hamanoe663a7a2006-01-25 12:37:28685Create a bare repository to publish your changes to the public
Junio C Hamano38064d52006-01-15 10:13:49686</dt>
687<dd>
688<div class="listingblock">
689<div class="content">
Junio C Hamanoe663a7a2006-01-25 12:37:28690<pre><tt>$ git clone --bare -l /home/proj/.git /pub/scm/proj.git</tt></pre>
Junio C Hamano38064d52006-01-15 10:13:49691</div></div>
692</dd>
693<dt>
694Create a repository on the kernel.org machine that borrows from Linus
695</dt>
696<dd>
697<div class="listingblock">
698<div class="content">
Junio C Hamanoe663a7a2006-01-25 12:37:28699<pre><tt>$ git clone --bare -l -s /pub/scm/.../torvalds/linux-2.6.git \
Junio C Hamano38064d52006-01-15 10:13:49700 /pub/scm/.../me/subsys-2.6.git</tt></pre>
701</div></div>
702</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31703</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:23704</div>
Junio C Hamanoba4b9282008-07-06 05:20:31705<h2 id="_author">Author</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23706<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31707<div class="para"><p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23708</div>
Junio C Hamanoba4b9282008-07-06 05:20:31709<h2 id="_documentation">Documentation</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23710<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31711<div class="para"><p>Documentation by Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23712</div>
Junio C Hamanoba4b9282008-07-06 05:20:31713<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23714<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31715<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23716</div>
717<div id="footer">
718<div id="footer-text">
Junio C Hamanoba4b9282008-07-06 05:20:31719Last updated 2008-07-06 05:16:38 UTC
Junio C Hamano1a4e8412005-12-27 08:17:23720</div>
721</div>
722</body>
723</html>