git clone

Download a repository from a server with its whole history

What it does

git clone creates a folder named after the repository, downloads every commit and branch into it and switches to the main branch. The server is added as a remote called origin right away, so git pull and git push work with no setup.

Addresses come in two kinds: HTTPS (https://github.com/…) and SSH (git@github.com:…). SSH is handier once you have an SSH key set up: no password or token to type. A last argument names your own folder instead of the repository name.

Syntax

git clone <address>
git clone <address> <folder>

Examples

Related commands

Practise · All commands