1CG-CLONE(1)                                                        CG-CLONE(1)
2
3
4

NAME

6       cg-clone - clone a remote repository
7

SYNOPSIS

9       cg-clone [-l] [-b] [-s] LOCATION [DESTDIR]
10
11

DESCRIPTION

13       This clones a remote GIT repository and checks it out locally.
14
15       Takes a parameter specifying the location of the source repository and
16       an optional second parameter specifying the destination. If the second
17       parameter is omitted, the basename of the source repository is used as
18       the destination.
19
20       For detailed description of the location of the source repository
21       format (available protocols, specifying different remote branch, etc)
22       please see the cg-branch-add(1) documentation.
23
24

OPTIONS

26       -b     Create only the bare repository, without a working copy
27              attached; this is useful e.g. for public repository mirrors.
28              cg-clone(1) is to cg-init(1) as cg-clone -b is to
29              cg-admin-setuprepo(1). (Still, if you are setting up a public or
30              a central repository other people will push into, it might be
31              more practical to just cg-admin-setuprepo(1) it and then
32              populate it with cg-push(1) from the other side.)
33
34       -l     Instead of hardlinking all the objects, set up an "alternate"
35              record pointing at the source object database; this will cause
36              any objects not found locally to be looked up remotely, which
37              effectively eliminates the need to copy/hardlink the objects
38              around. This is suitable for very fast cloning of arbitrarily
39              big repositories, but your repository will become largely
40              useless if the source repository disappears or gets damaged
41              (note that it is generally BAD IDEA to prune the original
42              repository if any repository is borrowing objects from it). The
43              choice is yours.
44
45       --reference PATH
46              This does the same thing as -l but instead of borrowing the
47              objects from the source repository, it borrows them from yet
48              another local repository. E.g. if you have Linus' kernel
49              repository cloned locally and now want to clone akpm's
50              repository, you can do something like
51
52              cg-clone --reference /path/to/linus/repo
53              git://kernel.org/akpm/repo
54
55              and it will download and keep only the objects that are really
56              missing. Same considerations and warnings on the third-party
57              source as in the case of -l apply. Also, you can reference only
58              local repositories.
59
60       -s     Clone in the current directory instead of creating a new one.
61              Specifying both -s and a destination directory makes no sense.
62
63       -h, --help
64              Print usage summary.
65
66       --long-help
67              Print user manual. The same as found in cg-clone(1).
68

NOTES

70       If the clone has been interrupted for any reason, do not panic, calmly
71       cd to the destination directory and run cg-fetch(1), which will in this
72       case restart the initial clone. Chances are that you will not actually
73       download any duplicate data. (At the time of writing this, the chances
74       aren't for the native git protocol and ssh, but this may change in the
75       future).
76
77

EXAMPLE USAGE

79       If you want to clone the Cogito repository, you can say:
80
81
82       $ cg-clone http://www.kernel.org/pub/scm/cogito/cogito.git
83       and it will be cloned to the cogito subdirectory of the current
84       directory.
85
86       To clone the next branch of the Git repository, do e.g.:
87
88
89       $ cg-clone git://git.kernel.org/pub/scm/git/git.git#next
90
92       Copyright © Petr Baudis, 2005
93
94

SEE ALSO

96       cg-clone is part of cogito(7), a toolkit for managing git(7) trees.
97
98
99
100
101                                  12/11/2006                       CG-CLONE(1)
Impressum