Git command `clone`
Definition
Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository (visible using
git branch -r
), and creates and checks out an initial branch that is forked from the cloned repository’s currently active branch.
Basic usage
Clones remote repository locally
$ git clone <path/to/remote.git>
Advanced usage
Clones remote repository locally then navigate to <branch>
$ git clone -b <branch> -- <path/to/remote.git>