git clone

The command that copies an entire repository, every commit and branch, from a remote to a new folder on your machine.

In more detail

It creates the folder, copies the history, names the source remote origin, creates remote-tracking branches, and checks out the default branch with its upstream set. The result is a full, independent repository. Hooks and local config are not copied, because .git/hooks and .git/config are not part of the history.

Examples

git clone ../remote.git project
Every clone is a complete copy of every secret ever committed, which is why the course counts clones when deciding whether rewriting history would even help.
In Terraform: A freshly cloned Terraform repository has no downloaded plugins, modules or backend connection. That is why terraform init is always the first command after cloning.

Related terms

Taught in

References

Certification courses