Search notes:

git clone

Clone a repository into a new directory.
Cloning a repository automatically creates a remote named origin.

Shallow clone

Using the --depth option allows to create a shallow clone of a repository where the history is truncated to the specified number of the most recent commits, thus using less bandwith and disk space resources.
$ git clone --depth 1 -b master https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git ~/linux/

warning: You appear to have cloned an empty repository.

git init --quiet --bare repo
Github repository about-git, path: /commands/clone/warning-You-appear-to-have-cloned-an-empty-repository/init-bare.ps1
git clone --quiet file://$pwd/repo repo-cloned
Github repository about-git, path: /commands/clone/warning-You-appear-to-have-cloned-an-empty-repository/clone.ps1
When trying to show an empty repository's history with git log, git will show the message fatal: your current branch 'master' does not have any commits yet.

Include submodules

git clone --recurse-submodules  https://github.com/…
After cloning a repository, its submodules might be required to be «updated»: git submodule --init --force --remote.

See also

After cloning a repository, the URL from which the repository was cloned can (always?, sometimes?) be queried with
git remote get-url origin
4 types of Git URLs
Effects of git clone to the .git/config file.
git switch to a remote branch after cloning a repository.
git commands

Index