Home Explore Blog CI



git

5th chunk of `Documentation/git-clone.adoc`
2caa7dc97daf78e015aaa2b7f07e28618dbdd1b7ef8b5e8100000001000008fc
 `HEAD` points at.
	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 `--single-branch` clone was made, no remote-tracking
	branch is created.

`--[no-]tags`::
	Control whether or not tags will be cloned. When `--no-tags` is
	given, the option will be become permanent by setting the
	`remote.<remote>.tagOpt=--no-tags` configuration. This ensures that
	future `git pull` and `git fetch` won't follow any tags. Subsequent
	explicit tag fetches will still work (see linkgit:git-fetch[1]).
+
By default, tags are cloned and passing `--tags` is thus typically a
no-op, unless it cancels out a previous `--no-tags`.
+
Can be used in conjunction with `--single-branch` to clone and
maintain a branch with no references other than a single cloned
branch. This is useful e.g. to maintain minimal clones of the default
branch of some repository for search indexing.

`--recurse-submodules[=<pathspec>]`::
	After the clone is created, initialize and clone submodules
	within based on the provided _<pathspec>_.  If no `=<pathspec>` is
	provided, all submodules are initialized and cloned.
	This option can be given multiple times for pathspecs consisting
	of multiple entries.  The resulting clone has `submodule.active` set to
	the provided pathspec, or "`.`" (meaning all submodules) if no
	pathspec is provided.
+
Submodules are initialized and cloned using their default settings. This is
equivalent to running
`git submodule update --init --recursive <pathspec>` 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 `--no-checkout`/`-n`, `--bare`,
or `--mirror` is given)

`--[no-]shallow-submodules`::
	All submodules which are cloned will be shallow with a depth of 1.

`--[no-]remote-submodules`::
	All submodules which are cloned will use the status of the submodule's
	remote-tracking branch to update the submodule, rather than the
	superproject's recorded SHA-1. Equivalent to passing `--remote` to
	`git submodule update`.

`--separate-git-dir=<git-dir>`::
	Instead of placing the cloned repository where it is supposed
	to be, place the cloned

Title: Git Clone Options for Submodules and Repository Configuration
Summary
The git clone command provides options to control the cloning of submodules, including initialization, recursion, and shallow cloning, as well as configuring the repository itself, such as setting the git directory and remote-tracking branch behavior.