
Module 12 Capstone Part 2: Feature Development and Review
Build the feature. In Part 2 of the Capstone, you will practice the Feature Branch Workflow, use interactive rebase to polish your history, and simulate a professional code review loop.
Module 12 Capstone Part 2: Feature Development and Review
In Part 1, we set up the architecture. In Part 2, we simulate a fast-paced development sprint using the GitHub Flow strategy.
Phase 3: The Feature Loop
- Branch Out: Inside your
git-web-app, create a branch calledfeature/dark-mode. - First Commit: Edit
index.htmlto add a "Dark Mode" class to the body. Commit it:feat: Add basic structure for dark mode toggle. - The "Messy" Work: Make 3 more commits with small, insignificant changes (e.g., typos, dummy text). Give them bad messages like "WIP", "asdf", and "last one".
Phase 4: History Polishing
Before you submit your code for "Review," you must clean up your mess.
- Interactive Rebase: Run
git rebase -i HEAD~4. - Squash: Combine your 3 messy commits into your first high-quality commit.
- Word Choice: Change the commit message to be a comprehensive summary:
feat: Implement full dark mode support across landing page. - Verification: Run
git log --oneline. Your branch should now look like it was built by a perfect, error-free engineer.
Phase 5: The Simulated Review
- Merge Preparation: Switch back to
main. - The Conflict: Create a subtle merge conflict. While on
main, edit the same line inindex.htmlthat you changed in your branch. Commit it. - Merge and Resolve: Try to merge
feature/dark-modeintomain. - The Fix: Manually resolve the conflict, stage the file, and complete the merge.
graph LR
Main["main"] -- "Branch" --> Feature["feature/dark-mode"]
Feature -- "3 Dirty Commits" --> Feature
Feature -- "Interactive Rebase" --> Polish["1 Clean Commit"]
Polish -- "Merge Conflict" --> Main
Main -- "Resolved" --> Live["Live Site"]
Capstone Progress Check
By the end of Part 2, you should have:
- Mastered the creation and merging of branches.
- Used rebase to transform "Dirty" work into "Clean" history.
- Successfully navigated a real-world merge conflict.
Status: Feature integrated. History is clean.
Next Part: Capstone Part 3: Release and Emergency Fixes. We’ll handle production tags and a high-pressure recovery scenario.