Module 3 · ~40 min
GitHub Pages — your username.github.io site
Goal: Publish a simple personal webpage hosted free on GitHub.
Two common patterns
| Pattern | Repo name | Live URL |
|---|---|---|
| User site | <username>.github.io | https://<username>.github.io |
| Project site | hello-github | https://<username>.github.io/hello-github/ |
Steps — user site
- Create a public repo named exactly
<your-username>.github.io. - Add file
index.htmlvia Add file → Create new file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My GitHub Page</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is my first GitHub Pages site.</p>
</body>
</html>
- Commit to
main. - Settings → Pages → Deploy from branch
main/ root → Save. - Wait 1–3 minutes, then open your live URL.
Tip: If you see 404, wait longer, confirm the repo is public, and check
index.html is on main.Checklist
- I created
username.github.io(or a project Pages repo) index.htmlis committed onmain- Pages is enabled in Settings
- My site loads in the browser