- Create a GitHub repository
- Clone a GitHub repository
- Add an empty webpage to a local repo
- Commit changes to
index.html
. push
local changes to GitHub.- Deploy your GitHub repo to GitHub Pages.
- You have a local commits that have not been pushed.
-
Check your repo status.
$ git status
You need to be ahead of your remote repo by at least 1 commit (otherwise, there's nothing to push):
On branch main Your branch is ahead of 'origin/main' by 1 commit. (use "git push" to publish your local commits) nothing to commit, working tree clean
-
push
your changes:$ git push
Your latest commits will be synced with the remote repo:
Enumerating objects: 4, done. Counting objects: 100% (4/4), done. Delta compression using up to 4 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 449 bytes | 449.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 To github.com:USERNAME/REPOSITORY.git 16e6466..169a1b0 main -> main
-
Check your repo status (just in case).
$ git status
You should now be up to date with your remote repo:
On branch main Your branch is up to date with 'origin/main'. nothing to commit, working tree clean