Back

Creating repositories

A repository (repo) is a project folder that GitHub stores along with its full history. You can create it on GitHub first, or start locally and push it up.

# Start locally, then push to a new GitHub repo
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/username/my-app.git
git push -u origin main

# Or with the GitHub CLI
gh repo create my-app --public --source=. --push

# Copy an existing repo
git clone https://github.com/username/my-app.git

Roadmap