Home / Git / Lesson 5

GitHub: remote, push, clone, pull

Beginner 8 min read Lesson 5 of 5

On GitHub, create a new repository without a README if you already ran git init locally (two READMEs cause a noisy first merge). Then:

git remote add origin https://github.com/YOUR_USER/YOUR_REPO.git
git push -u origin main

GitHub will ask you to sign in (browser or a personal access token — passwords for Git HTTPS were removed years ago). SSH uses a key pair instead of a token; set it up in GitHub settings if you push often.

git clone URL copies the repo to a new folder. git pull fetches and merges (or rebases, if you configured that) so you get commits others pushed.

Hosting a static site from a repo is covered in Host a website free (GitHub Pages, Netlify, Vercel).