Git Reference
Git Reference / Starting a repo

03Starting a repo

Create a new repo

Turn the current directory into a Git repository.

git init
git init my-project       # create a new folder

Clone an existing repo

Download a full copy including history.

git clone https://github.com/user/repo.git
git clone git@github.com:user/repo.git my-dir
git clone --depth 1 <url>      # shallow: latest commit only
git clone --filter=blob:none <url>  # partial: fetch file contents lazily