Lesson 18: Deploy to GitHub Pages
What You'll Learn
- Understand Git and GitHub and why developers use version control
- Initialize a repo, stage files, commit, and push to GitHub
- Enable GitHub Pages and get a live URL for your portfolio
- Understand the deployment workflow used by real web developers
Version Control with Git
Git is a version control system — software that tracks every change you make to a codebase over time. Think of it as an unlimited undo history that works across an entire project. GitHub is a hosting service where you store Git repositories online and collaborate with others.
Every web developer uses Git daily. Learning it now gives you a major advantage in college and on the job.
Core Git Concepts
.git/ folder.
main. Branches let you experiment without breaking working code.
The Git Workflow
Every commit follows the same three-step cycle:
git add .— Stage all changed files (mark them to be included in the next commit)git commit -m "Your message"— Create the snapshot with a descriptiongit push— Upload the snapshot to GitHub
You repeat this cycle every time you finish a meaningful unit of work — a feature, a bug fix, or a section of a project.
GitHub Pages
GitHub Pages turns any repository into a free, live website. When you push an index.html to a repo named yourusername.github.io, GitHub automatically serves it at https://yourusername.github.io. For other repos you enable Pages in Settings and your site lives at https://yourusername.github.io/repo-name.
Your portfolio will be instantly accessible to employers, colleges, and collaborators worldwide — for free, forever.
Quick Check
1. What does git add . do?
2. Which repo name gives you a root GitHub Pages URL like https://alice.github.io?
3. What is a Git commit?
4. After enabling GitHub Pages, how long does it typically take for your site to go live?