Create & Clone Repositories in Git

From the Git cheat sheet ยท Getting Started ยท verified Nov 2026

Create & Clone Repositories

Start a new project or get an existing one

bash
# Create new repository
git init
git init <directory>

# Clone existing repository
git clone <url>
git clone <url> <directory>

# Clone and check out a specific branch
git clone -b <branch> <url>
๐Ÿ’ก Clone creates a full copy with history
โšก Use shallow clone for faster downloads
๐Ÿ“Œ Init creates a new .git directory
๐Ÿ“Œ --depth implies --single-branch

Continue with Git

Save the full cheat sheet or work through every related task.

More Git tasks

Back to the full Git cheat sheet