Command Reference

git clone Tutorial

Explains how git clone copies a repository, what origin means by default, and what local branch setup usually looks like after cloning.

The short version

git clone copies an existing repository locally, including its history, objects, refs, and default remote configuration.

Basic usage

git clone https://example.com/repo.git
git clone https://example.com/repo.git my-project

What clone sets up

  • a full local repository
  • a default remote usually named origin
  • an initial checkout of the default branch