cg-clone(1)
===========

NAME
----
cg-clone - clone a remote repository

SYNOPSIS
--------
cg-clone [-l] [-b] [-s] LOCATION [DESTDIR]

DESCRIPTION
-----------
This clones a remote GIT repository and checks it out locally.

Takes a parameter specifying the location of the source repository and an
optional second parameter specifying the destination. If the second
parameter is omitted, the basename of the source repository is used as the
destination.

For detailed description of the location of the source repository format
(available protocols, specifying different remote branch, etc) please see
the gitlink:cg-branch-add[1] documentation.

OPTIONS
-------

--
-b::
	Create only the bare repository, without a working copy attached;
	this is useful e.g. for public repository mirrors. gitlink:cg-clone[1]
	is to gitlink:cg-init[1] as `cg-clone -b` is to gitlink:cg-admin-setuprepo[1].
	(Still, if you are setting up a public or a central repository
	other people will push into, it might be more practical to just
	gitlink:cg-admin-setuprepo[1] it and then populate it with gitlink:cg-push[1]
	from the other side.)

-l::
	Symlink the object database when cloning locally, instead of
	hardlinking all the objects. This is suitable for very fast
	cloning of arbitrarily big repositories, but might be a trouble
	in multi-user environments, and less solid arrangement in case
	you do dangerous things with the database. Also, disappeared
	or moved origin repository will obviously render this one unusable
	as well. The choice is yours.
	Note that you MUST NOT prune repository containing a symlink
	or being symlinked to.

-s::
	Clone in the current directory instead of creating a new one.
	Specifying both -s and a destination directory makes no sense.


-h, --help::
	Print usage summary.

--long-help::
	Print user manual. The same as found in gitlink:cg-clone[1].
--


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

EXAMPLE USAGE
-------------
If you want to clone the Cogito repository, you can say:

	$ cg-clone http://www.kernel.org/pub/scm/cogito/cogito.git

and it will be cloned to the 'cogito' subdirectory of the current directory.

To clone the 'next' branch of the Git repository, do e.g.:

	$ cg-clone git://git.kernel.org/pub/scm/git/git.git#next

COPYRIGHT
---------
Copyright (C) Petr Baudis, 2005

SEE ALSO
--------
cg-clone is part of gitlink:cogito[7],
a toolkit for managing gitlink:git[7] trees.
