@matheusbsbs / matheus-bagliano / commits / 23edecbc9a
Fork 0

Document git-clone --reference

The new --reference flag introduced to git-clone in GIT 1.3.0 was not documented but is rather handy. So document it. Also corrected a minor issue with the documentation for the -s flag; the info/alternates file name was spelled wrong. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Shawn Pearce committed Apr 18, 2006 at 20:19 UTC 23edecbc9a5566ac5aa8fb251fbcf8bb83694837
1 file changed +20 -1
Documentation/git-clone.txt
+20 -1
@@ -10,6 +10,7 @@ SYNOPSIS
10 --------
11 [verse]
12 'git-clone' [-l [-s]] [-q] [-n] [--bare] [-o <name>] [-u <upload-pack>]
13 + [--reference <repository>]
14 <repository> [<directory>]
15
16 DESCRIPTION
@@ -46,10 +47,18 @@ OPTIONS
47 -s::
48 When the repository to clone is on the local machine,
49 instead of using hard links, automatically setup
49 - .git/objects/info/alternatives to share the objects
50 + .git/objects/info/alternates to share the objects
51 with the source repository. The resulting repository
52 starts out without any object of its own.
53
54 +--reference <repository>::
55 + If the reference repository is on the local machine
56 + automatically setup .git/objects/info/alternates to
57 + obtain objects from the reference repository. Using
58 + an already existing repository as an alternate will
59 + require less objects to be copied from the repository
60 + being cloned, reducing network and local storage costs.
61 +
62 --quiet::
63 -q::
64 Operate quietly. This flag is passed to "rsync" and
@@ -112,6 +121,16 @@ $ git show-branch
121 ------------
122
123
124 +Clone from upstream while borrowing from an existing local directory::
125 ++
126 +------------
127 +$ git clone --reference my2.6 \
128 + git://git.kernel.org/pub/scm/.../linux-2.7 \
129 + my2.7
130 +$ cd my2.7
131 +------------
132 +
133 +
134 Create a bare repository to publish your changes to the public::
135 +
136 ------------