summaryrefslogtreecommitdiffstats
path: root/git-clone.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-10-31 13:25:53 -0700
committerJunio C Hamano <gitster@pobox.com>2014-10-31 13:25:53 -0700
commitc14e6ad9a230ad90c84b7f620d87fbe49a2d0342 (patch)
tree120346dc383e3d1c4219fe8c533eb22cb6af2b55 /git-clone.html
parent2a4bcbc355496c8d83b1b9f8892c4cbe8f584158 (diff)
downloadgit-htmldocs-c14e6ad9a230ad90c84b7f620d87fbe49a2d0342.tar.gz
Autogenerated HTML docs for v2.2.0-rc0
Diffstat (limited to 'git-clone.html')
-rw-r--r--git-clone.html154
1 files changed, 76 insertions, 78 deletions
diff --git a/git-clone.html b/git-clone.html
index 104fbd75a..65a8f35a9 100644
--- a/git-clone.html
+++ b/git-clone.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
-<meta name="generator" content="AsciiDoc 8.6.6" />
+<meta name="generator" content="AsciiDoc 8.6.9" />
<title>git-clone(1)</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
@@ -87,10 +87,16 @@ ul, ol, li > p {
ul > li { color: #aaa; }
ul > li > * { color: black; }
-pre {
+.monospaced, code, pre {
+ font-family: "Courier New", Courier, monospace;
+ font-size: inherit;
+ color: navy;
padding: 0;
margin: 0;
}
+pre {
+ white-space: pre-wrap;
+}
#author {
color: #527bbd;
@@ -219,7 +225,7 @@ div.exampleblock > div.content {
}
div.imageblock div.content { padding-left: 0; }
-span.image img { border-style: none; }
+span.image img { border-style: none; vertical-align: text-bottom; }
a.image:visited { color: white; }
dl {
@@ -349,7 +355,7 @@ div.colist td img {
margin-bottom: 0.1em;
}
-div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
@@ -407,18 +413,14 @@ span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }
+div.unbreakable { page-break-inside: avoid; }
+
/*
* xhtml11 specific
*
* */
-tt {
- font-family: monospace;
- font-size: inherit;
- color: navy;
-}
-
div.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -452,12 +454,6 @@ div.tableblock > table[frame="vsides"] {
*
* */
-.monospaced {
- font-family: monospace;
- font-size: inherit;
- color: navy;
-}
-
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -537,6 +533,8 @@ body.manpage div.sectionbody {
@media print {
body.manpage div#toc { display: none; }
}
+
+
</style>
<script type="text/javascript">
/*<![CDATA[*/
@@ -581,7 +579,7 @@ toc: function (toclevels) {
function tocEntries(el, toclevels) {
var result = new Array;
- var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
+ var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
// Function that scans the DOM tree for header elements (the DOM2
// nodeIterator API would be a better technique but not supported by all
// browsers).
@@ -610,7 +608,7 @@ toc: function (toclevels) {
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
- if (entry.nodeName == 'div'
+ if (entry.nodeName.toLowerCase() == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
@@ -656,7 +654,7 @@ footnotes: function () {
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
- if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
+ if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
@@ -766,17 +764,17 @@ git-clone(1) Manual Page
<div class="sectionbody">
<div class="paragraph"><p>Clones a repository into a newly created directory, creates
remote-tracking branches for each branch in the cloned repository
-(visible using <tt>git branch -r</tt>), and creates and checks out an
+(visible using <code>git branch -r</code>), and creates and checks out an
initial branch that is forked from the cloned repository&#8217;s
currently active branch.</p></div>
-<div class="paragraph"><p>After the clone, a plain <tt>git fetch</tt> without arguments will update
-all the remote-tracking branches, and a <tt>git pull</tt> without
+<div class="paragraph"><p>After the clone, a plain <code>git fetch</code> without arguments will update
+all the remote-tracking branches, and a <code>git pull</code> without
arguments will in addition merge the remote master branch into the
current master branch, if any (this is untrue when "--single-branch"
is given; see below).</p></div>
<div class="paragraph"><p>This default configuration is achieved by creating references to
-the remote branch heads under <tt>refs/remotes/origin</tt> and
-by initializing <tt>remote.origin.url</tt> and <tt>remote.origin.fetch</tt>
+the remote branch heads under <code>refs/remotes/origin</code> and
+by initializing <code>remote.origin.url</code> and <code>remote.origin.fetch</code>
configuration variables.</p></div>
</div>
</div>
@@ -796,14 +794,14 @@ configuration variables.</p></div>
this flag bypasses the normal "Git aware" transport
mechanism and clones the repository by making a copy of
HEAD and everything under objects and refs directories.
- The files under <tt>.git/objects/</tt> directory are hardlinked
+ The files under <code>.git/objects/</code> directory are hardlinked
to save space when possible.
</p>
-<div class="paragraph"><p>If the repository is specified as a local path (e.g., <tt>/path/to/repo</tt>),
+<div class="paragraph"><p>If the repository is specified as a local path (e.g., <code>/path/to/repo</code>),
this is the default, and --local is essentially a no-op. If the
repository is specified as a URL, then this flag is ignored (and we
-never use the local optimizations). Specifying <tt>--no-local</tt> will
-override the default when <tt>/path/to/repo</tt> is given, using the regular
+never use the local optimizations). Specifying <code>--no-local</code> will
+override the default when <code>/path/to/repo</code> is given, using the regular
Git transport instead.</p></div>
</dd>
<dt class="hdlist1">
@@ -812,7 +810,7 @@ Git transport instead.</p></div>
<dd>
<p>
Force the cloning process from a repository on a local
- filesystem to copy the files under the <tt>.git/objects</tt>
+ filesystem to copy the files under the <code>.git/objects</code>
directory instead of using hardlinks. This may be desirable
if you are trying to make a back-up of your repository.
</p>
@@ -827,7 +825,7 @@ Git transport instead.</p></div>
<p>
When the repository to clone is on the local machine,
instead of using hard links, automatically setup
- <tt>.git/objects/info/alternates</tt> to share the objects
+ <code>.git/objects/info/alternates</code> to share the objects
with the source repository. The resulting repository
starts out without any object of its own.
</p>
@@ -836,17 +834,17 @@ it unless you understand what it does. If you clone your
repository using this option and then delete branches (or use any
other Git command that makes any existing commit unreferenced) in the
source repository, some objects may become unreferenced (or dangling).
-These objects may be removed by normal Git operations (such as <tt>git commit</tt>)
-which automatically call <tt>git gc --auto</tt>. (See <a href="git-gc.html">git-gc(1)</a>.)
+These objects may be removed by normal Git operations (such as <code>git commit</code>)
+which automatically call <code>git gc --auto</code>. (See <a href="git-gc.html">git-gc(1)</a>.)
If these objects are removed and were referenced by the cloned repository,
then the cloned repository will become corrupt.</p></div>
-<div class="paragraph"><p>Note that running <tt>git repack</tt> without the <tt>-l</tt> option in a repository
-cloned with <tt>-s</tt> will copy objects from the source repository into a pack
-in the cloned repository, removing the disk space savings of <tt>clone -s</tt>.
-It is safe, however, to run <tt>git gc</tt>, which uses the <tt>-l</tt> option by
+<div class="paragraph"><p>Note that running <code>git repack</code> without the <code>-l</code> option in a repository
+cloned with <code>-s</code> will copy objects from the source repository into a pack
+in the cloned repository, removing the disk space savings of <code>clone -s</code>.
+It is safe, however, to run <code>git gc</code>, which uses the <code>-l</code> option by
default.</p></div>
-<div class="paragraph"><p>If you want to break the dependency of a repository cloned with <tt>-s</tt> on
-its source repository, you can simply run <tt>git repack -a</tt> to copy all
+<div class="paragraph"><p>If you want to break the dependency of a repository cloned with <code>-s</code> on
+its source repository, you can simply run <code>git repack -a</code> to copy all
objects from the source repository into a pack in the cloned repository.</p></div>
</dd>
<dt class="hdlist1">
@@ -855,13 +853,13 @@ objects from the source repository into a pack in the cloned repository.</p></di
<dd>
<p>
If the reference repository is on the local machine,
- automatically setup <tt>.git/objects/info/alternates</tt> to
+ automatically setup <code>.git/objects/info/alternates</code> to
obtain objects from the reference repository. Using
an already existing repository as an alternate will
require fewer objects to be copied from the repository
being cloned, reducing network and local storage costs.
</p>
-<div class="paragraph"><p><strong>NOTE</strong>: see the NOTE for the <tt>--shared</tt> option.</p></div>
+<div class="paragraph"><p><strong>NOTE</strong>: see the NOTE for the <code>--shared</code> option.</p></div>
</dd>
<dt class="hdlist1">
--quiet
@@ -916,13 +914,13 @@ objects from the source repository into a pack in the cloned repository.</p></di
<dd>
<p>
Make a <em>bare</em> Git repository. That is, instead of
- creating <tt>&lt;directory&gt;</tt> and placing the administrative
- files in <tt>&lt;directory&gt;/.git</tt>, make the <tt>&lt;directory&gt;</tt>
- itself the <tt>$GIT_DIR</tt>. This obviously implies the <tt>-n</tt>
+ creating <code>&lt;directory&gt;</code> and placing the administrative
+ files in <code>&lt;directory&gt;/.git</code>, make the <code>&lt;directory&gt;</code>
+ itself the <code>$GIT_DIR</code>. This obviously implies the <code>-n</code>
because there is nowhere to check out the working tree.
Also the branch heads at the remote are copied directly
to corresponding local branch heads, without mapping
- them to <tt>refs/remotes/origin/</tt>. When this option is
+ them to <code>refs/remotes/origin/</code>. When this option is
used, neither remote-tracking branches nor the related
configuration variables are created.
</p>
@@ -932,11 +930,11 @@ objects from the source repository into a pack in the cloned repository.</p></di
</dt>
<dd>
<p>
- Set up a mirror of the source repository. This implies <tt>--bare</tt>.
- Compared to <tt>--bare</tt>, <tt>--mirror</tt> not only maps local branches of the
+ Set up a mirror of the source repository. This implies <code>--bare</code>.
+ Compared to <code>--bare</code>, <code>--mirror</code> not only maps local branches of the
source to local branches of the target, it maps all refs (including
remote-tracking branches, notes etc.) and sets up a refspec configuration such
- that all these refs are overwritten by a <tt>git remote update</tt> in the
+ that all these refs are overwritten by a <code>git remote update</code> in the
target repository.
</p>
</dd>
@@ -948,8 +946,8 @@ objects from the source repository into a pack in the cloned repository.</p></di
</dt>
<dd>
<p>
- Instead of using the remote name <tt>origin</tt> to keep track
- of the upstream repository, use <tt>&lt;name&gt;</tt>.
+ Instead of using the remote name <code>origin</code> to keep track
+ of the upstream repository, use <code>&lt;name&gt;</code>.
</p>
</dd>
<dt class="hdlist1">
@@ -961,10 +959,10 @@ objects from the source repository into a pack in the cloned repository.</p></di
<dd>
<p>
Instead of pointing the newly created HEAD to the branch pointed
- to by the cloned repository&#8217;s HEAD, point to <tt>&lt;name&gt;</tt> branch
+ to by the cloned repository&#8217;s HEAD, point to <code>&lt;name&gt;</code> branch
instead. In a non-bare repository, this is the branch that will
be checked out.
- <tt>--branch</tt> can also take tags and detaches the HEAD at that commit
+ <code>--branch</code> can also take tags and detaches the HEAD at that commit
in the resulting repository.
</p>
</dd>
@@ -1002,7 +1000,7 @@ objects from the source repository into a pack in the cloned repository.</p></di
this takes effect immediately after the repository is
initialized, but before the remote history is fetched or any
files checked out. The key is in the same format as expected by
- <a href="git-config.html">git-config(1)</a> (e.g., <tt>core.eol=true</tt>). If multiple
+ <a href="git-config.html">git-config(1)</a> (e.g., <code>core.eol=true</code>). If multiple
values are given for the same key, each value will be written to
the config file. This makes it safe, for example, to add
additional fetch refspecs to the origin remote.
@@ -1023,15 +1021,15 @@ objects from the source repository into a pack in the cloned repository.</p></di
<dd>
<p>
Clone only the history leading to the tip of a single branch,
- either specified by the <tt>--branch</tt> option or the primary
- branch remote&#8217;s <tt>HEAD</tt> points at. When creating a shallow
- clone with the <tt>--depth</tt> option, this is the default, unless
- <tt>--no-single-branch</tt> is given to fetch the histories near the
+ either specified by the <code>--branch</code> option or the primary
+ branch remote&#8217;s <code>HEAD</code> points at. When creating a shallow
+ clone with the <code>--depth</code> option, this is the default, unless
+ <code>--no-single-branch</code> is given to fetch the histories near the
tips of all branches.
Further fetches into the resulting repository will only update the
remote-tracking branch for the branch this option was used for the
initial cloning. If the HEAD at the remote did not point at any
- branch when <tt>--single-branch</tt> clone was made, no remote-tracking
+ branch when <code>--single-branch</code> clone was made, no remote-tracking
branch is created.
</p>
</dd>
@@ -1045,10 +1043,10 @@ objects from the source repository into a pack in the cloned repository.</p></di
<p>
After the clone is created, initialize all submodules within,
using their default settings. This is equivalent to running
- <tt>git submodule update --init --recursive</tt> immediately after
+ <code>git submodule update --init --recursive</code> immediately after
the clone is finished. This option is ignored if the cloned
repository does not have a worktree/checkout (i.e. if any of
- <tt>--no-checkout</tt>/<tt>-n</tt>, <tt>--bare</tt>, or <tt>--mirror</tt> is given)
+ <code>--no-checkout</code>/<code>-n</code>, <code>--bare</code>, or <code>--mirror</code> is given)
</p>
</dd>
<dt class="hdlist1">
@@ -1080,8 +1078,8 @@ objects from the source repository into a pack in the cloned repository.</p></di
<p>
The name of a new directory to clone into. The "humanish"
part of the source repository is used if no directory is
- explicitly given (<tt>repo</tt> for <tt>/path/to/repo.git</tt> and <tt>foo</tt>
- for <tt>host.xz:foo/.git</tt>). Cloning into an existing directory
+ explicitly given (<code>repo</code> for <code>/path/to/repo.git</code> and <code>foo</code>
+ for <code>host.xz:foo/.git</code>). Cloning into an existing directory
is only allowed if the directory is empty.
</p>
</dd>
@@ -1139,8 +1137,8 @@ rsync://host.xz/path/to/repo.git/
</ul></div>
<div class="paragraph"><p>This syntax is only recognized if there are no slashes before the
first colon. This helps differentiate a local path that contains a
-colon. For example the local path <tt>foo:bar</tt> could be specified as an
-absolute path or <tt>./foo:bar</tt> to avoid being misinterpreted as an ssh
+colon. For example the local path <code>foo:bar</code> could be specified as an
+absolute path or <code>./foo:bar</code> to avoid being misinterpreted as an ssh
url.</p></div>
<div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
<div class="ulist"><ul>
@@ -1196,15 +1194,15 @@ use will be rewritten into URLs that work), you can create a
configuration section of the form:</p></div>
<div class="listingblock">
<div class="content">
-<pre><tt> [url "&lt;actual url base&gt;"]
- insteadOf = &lt;other url base&gt;</tt></pre>
+<pre><code> [url "&lt;actual url base&gt;"]
+ insteadOf = &lt;other url base&gt;</code></pre>
</div></div>
<div class="paragraph"><p>For example, with this:</p></div>
<div class="listingblock">
<div class="content">
-<pre><tt> [url "git://git.host.xz/"]
+<pre><code> [url "git://git.host.xz/"]
insteadOf = host.xz:/path/to/
- insteadOf = work:</tt></pre>
+ insteadOf = work:</code></pre>
</div></div>
<div class="paragraph"><p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
@@ -1212,14 +1210,14 @@ rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p
configuration section of the form:</p></div>
<div class="listingblock">
<div class="content">
-<pre><tt> [url "&lt;actual url base&gt;"]
- pushInsteadOf = &lt;other url base&gt;</tt></pre>
+<pre><code> [url "&lt;actual url base&gt;"]
+ pushInsteadOf = &lt;other url base&gt;</code></pre>
</div></div>
<div class="paragraph"><p>For example, with this:</p></div>
<div class="listingblock">
<div class="content">
-<pre><tt> [url "ssh://example.org/"]
- pushInsteadOf = git://example.org/</tt></pre>
+<pre><code> [url "ssh://example.org/"]
+ pushInsteadOf = git://example.org/</code></pre>
</div></div>
<div class="paragraph"><p>a URL like "git://example.org/path/to/repo.git" will be rewritten to
"ssh://example.org/path/to/repo.git" for pushes, but pulls will still
@@ -1236,9 +1234,9 @@ Clone from upstream:
</p>
<div class="listingblock">
<div class="content">
-<pre><tt>$ git clone git://git.kernel.org/pub/scm/.../linux.git my-linux
+<pre><code>$ git clone git://git.kernel.org/pub/scm/.../linux.git my-linux
$ cd my-linux
-$ make</tt></pre>
+$ make</code></pre>
</div></div>
</li>
<li>
@@ -1247,9 +1245,9 @@ Make a local clone that borrows from the current directory, without checking thi
</p>
<div class="listingblock">
<div class="content">
-<pre><tt>$ git clone -l -s -n . ../copy
+<pre><code>$ git clone -l -s -n . ../copy
$ cd ../copy
-$ git show-branch</tt></pre>
+$ git show-branch</code></pre>
</div></div>
</li>
<li>
@@ -1258,10 +1256,10 @@ Clone from upstream while borrowing from an existing local directory:
</p>
<div class="listingblock">
<div class="content">
-<pre><tt>$ git clone --reference /git/linux.git \
+<pre><code>$ git clone --reference /git/linux.git \
git://git.kernel.org/pub/scm/.../linux.git \
my-linux
-$ cd my-linux</tt></pre>
+$ cd my-linux</code></pre>
</div></div>
</li>
<li>
@@ -1270,7 +1268,7 @@ Create a bare repository to publish your changes to the public:
</p>
<div class="listingblock">
<div class="content">
-<pre><tt>$ git clone --bare -l /home/proj/.git /pub/scm/proj.git</tt></pre>
+<pre><code>$ git clone --bare -l /home/proj/.git /pub/scm/proj.git</code></pre>
</div></div>
</li>
</ul></div>