Tools · Lesson 72 of 76
Clone and create
There are two ways a project and GitHub meet:
Clone — copy an existing GitHub project onto your machine:
git clone https://github.com/someone/their-project.git
Create & push — put a project you started locally onto GitHub:
git init # start tracking this folder
git add .
git commit -m "First version"
git remote add origin https://github.com/you/your-project.git
git push -u origin main # upload it
After that first push, sharing new work is just git add ., git commit -m "...", then git push. Your code is now backed up and visible to the world (or just you, if the repo is private).
You’re reading for free. Sign in to keep your progress and earn a certificate when you finish.Sign in to keep my progress →