This capstone ties together everything from the Git module. You'll take a small web project from local files to a public GitHub repository.
Setup
Use your git-blog-practice project from earlier, or start fresh:
mkdir git-capstone
cd git-capstone
git init
Build a simple three-page site:
index.html— blog home with links to two postsabout.html— about youstyles.css— shared styling
Use semantic HTML from the HTML module and basic CSS from the CSS module.
Part 1 — Commits and History
- Add a
.gitignorebefore your first commit (see the.gitignorelesson for a starter template). - Make at least four meaningful commits — not one giant commit at the end. Example progression:
"Add index.html skeleton""Add about page""Add shared stylesheet""Style navigation links"
- Run
git log --onelineand confirm four distinct commits with clear messages.
Part 2 — Branch Experiment
- Create a branch:
git switch -c feature/dark-theme - Update
styles.csswith a dark color scheme. Commit on the branch. - Switch back to
main— confirm the light theme is still there. - Merge the branch:
git merge feature/dark-theme - Delete the branch:
git branch -d feature/dark-theme
Part 3 — Push to GitHub
- Create a new empty repository on GitHub.
- Connect it:
git remote add origin https://github.com/YOUR-USERNAME/REPO-NAME.git - Push:
git push -u origin main - Visit the repo in your browser and confirm all files and commits are visible.
Part 4 — Simulate Collaboration
- On GitHub, edit
README.mddirectly in the browser (GitHub creates it for you if missing). Add one sentence describing your blog. - Locally, run
git pullto bring that change down. - Make a local edit to
index.html— add one new sentence to the intro. - Commit and push:
git push - Refresh GitHub and confirm both changes are present.
Checklist
Before you finish, verify:
-
.gitignoreexists and ignores at least.envandnode_modules/ -
git log --onelineshows a readable history (4+ commits) - You successfully created, merged, and deleted a branch
- Your repo is on GitHub with all files visible
-
git pullandgit pushboth worked without errors
Bonus
- Open a pull request on a feature branch instead of merging locally: push a branch, open a PR on GitHub, merge through the UI, then
git pullon your machine. - Add a
README.mdlocally describing your project and push it.
Congratulations — you're using Git the way professional developers do. Every project from here forward should start with git init, include a .gitignore, and live on GitHub.