Home Explore Blog CI



git

2nd chunk of `Documentation/git-clone.adoc`
9b27e6f9c1a67801a0006e2a13529c64f3674f63652b0ef20000000100000fa2
	instead of using hard links, automatically setup
	`.git/objects/info/alternates` to share the objects
	with the source repository.  The resulting repository
	starts out without any object of its own.
+
*NOTE*: this is a possibly dangerous operation; do *not* use
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 `git commit`)
which automatically call `git maintenance run --auto`. (See
linkgit:git-maintenance[1].) If these objects are removed and were referenced
by the cloned repository, then the cloned repository will become corrupt.
+
Note that running `git repack` without the `--local` option in a repository
cloned with `--shared` will copy objects from the source repository into a pack
in the cloned repository, removing the disk space savings of `clone --shared`.
It is safe, however, to run `git gc`, which uses the `--local` option by
default.
+
If you want to break the dependency of a repository cloned with `--shared` on
its source repository, you can simply run `git repack -a` to copy all
objects from the source repository into a pack in the cloned repository.

`--reference[-if-able] <repository>`::
	If the reference _<repository>_ is on the local machine,
	automatically setup `.git/objects/info/alternates` 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.
	When using the `--reference-if-able`, a non existing
	directory is skipped with a warning instead of aborting
	the clone.
+
*NOTE*: see the NOTE for the `--shared` option, and also the
`--dissociate` option.

`--dissociate`::
	Borrow the objects from reference repositories specified
	with the `--reference` options only to reduce network
	transfer, and stop borrowing from them after a clone is made
	by making necessary local copies of borrowed objects.  This
	option can also be used when cloning locally from a
	repository that already borrows objects from another
	repository--the new repository will borrow objects from the
	same repository, and this option can be used to stop the
	borrowing.

`-q`::
`--quiet`::
	Operate quietly.  Progress is not reported to the standard
	error stream.

`-v`::
`--verbose`::
	Run verbosely. Does not affect the reporting of progress status
	to the standard error stream.

`--progress`::
	Progress status is reported on the standard error stream
	by default when it is attached to a terminal, unless `--quiet`
	is specified. This flag forces progress status even if the
	standard error stream is not directed to a terminal.

`--server-option=<option>`::
	Transmit the given string to the server when communicating using
	protocol version 2.  The given string must not contain a NUL or LF
	character.  The server's handling of server options, including
	unknown ones, is server-specific.
	When multiple `--server-option=<option>` are given, they are all
	sent to the other side in the order listed on the command line.
	When no ++--server-option=++__<option>__ is given from the command
	line, the values of configuration variable `remote.<name>.serverOption`
	are used instead.

`-n`::
`--no-checkout`::
	No checkout of `HEAD` is performed after the clone is complete.

`--`[`no-`]`reject-shallow`::
	Fail if the source repository is a shallow repository.
	The `clone.rejectShallow` configuration variable can be used to
	specify the default.

`--bare`::
	Make a 'bare' Git repository.  That is, instead of
	creating _<directory>_ and placing the administrative
	files in `<directory>/.git`, make the _<directory>_
	itself the `$GIT_DIR`. This obviously implies the `--no-checkout`
	because there is nowhere to check out the

Title: Git Clone Options
Summary
The git clone command has various options to customize the cloning process, including options to share objects with the source repository, break dependencies, control progress reporting, and specify server options, as well as options to create a bare repository, reject shallow repositories, and more.