Capstone: Git Workflow
Time: 30-60 minutes | Skills: Git Init, Commits, Branching, Pull Requests, Merge Conflicts
The Scenario
You are starting a brand new project: a Recipe Book web application. You will build it from scratch using a professional Git workflow — the same workflow used by real development teams. Every step will go through Claude Code.
By the end of this capstone, you will have a repository with multiple branches, several commits, a pull request, and a clean merge — all done through natural language conversation with Claude.
This capstone requires a GitHub account and the GitHub CLI (gh) installed and authenticated. If you have not set this up yet, refer to Lesson 3: Pull Requests for installation instructions.
Setup
-
Create a new repository on GitHub:
- Go to github.com/new.
- Name it
recipe-book. - Set it to Public (or Private if you prefer).
- Do not initialize it with a README (we will create everything through Claude).
- Click Create repository.
-
Set up the project locally. Open your terminal:
mkdir recipe-book
cd recipe-book
claude
Part 1: Initialize the Repository
Ask Claude to set up the Git repository and connect it to GitHub:
You: Initialize a Git repository here and connect it to my GitHub repository
at https://github.com/YOURUSERNAME/recipe-book
Replace YOURUSERNAME with your actual GitHub username. Claude will run git init, add the remote, and confirm the connection.
Part 2: Build the Foundation on Main
Create the initial project files on the main branch:
-
Create the project structure:
Create these files for a recipe book web app:
- index.html: A page with a heading "My Recipe Book" and an empty list
where recipes will go
- style.css: Basic styling with a clean, readable font and a warm color scheme
- app.js: A placeholder JavaScript file with a comment saying
"Recipe book app logic goes here" -
Initialize project memory:
/initReview the CLAUDE.md that gets created and ask Claude to adjust it if needed.
-
Make the initial commit:
Commit all files with the message "Initial project setup with HTML, CSS, and JS" -
Push to GitHub:
Push this to the main branch on GitHub -
Verify on GitHub — open your repository in a web browser and confirm the files are there.
Part 3: Feature Branch — Add Recipe List
Now create a feature branch and build a real feature:
-
Create the branch:
Create a new branch called add-recipe-list -
Build the feature:
Update index.html to include a list of 3 sample recipes:
- Classic Pancakes (15 minutes, easy)
- Pasta Carbonara (25 minutes, medium)
- Chocolate Chip Cookies (45 minutes, easy)
Each recipe should show the name, time, and difficulty.
Update style.css to make the recipe list look nice with cards or a clean layout. -
Review your changes before committing:
Show me what changed since the last commit -
Commit:
Commit these changesNotice the commit message Claude writes — it should describe the recipe list feature.
-
Add another improvement:
Add a search box at the top of the page that lets users filter recipes by name.
Add the JavaScript logic in app.js to make the filtering work. -
Commit again (separate commit for the separate feature):
Commit these changes -
Push the branch:
Push this branch to GitHub
Part 4: Create a Pull Request
-
Create the PR:
Create a pull request for this branch. The title should mention adding
the recipe list and search functionality. -
Read the PR description Claude generates. It should summarize both commits.
-
Review the PR yourself:
Review my pull request and give me feedback -
Address any feedback Claude provides. For example, if Claude suggests adding error handling or improving accessibility, make those changes:
Make the changes you suggested, then commit and push
Part 5: Simulate a Conflict (Optional Challenge)
If you want to practice conflict resolution:
-
Switch to main and make a small change to the same area:
Switch to main. Change the heading in index.html from "My Recipe Book"
to "Family Recipe Collection" and commit it. -
Switch back to your feature branch:
Switch to the add-recipe-list branch -
Try to merge main into your branch:
Merge the latest main branch into this branch -
Resolve the conflict — if one occurs, work with Claude to resolve it:
Resolve the conflict by keeping the "Family Recipe Collection" heading
from main -
Push the resolution:
Push the resolved merge to GitHub
Part 6: Merge the Pull Request
-
Merge the PR:
Merge my pull request using squash and merge -
Clean up:
Switch to main, pull the latest changes, and delete the add-recipe-list branch
both locally and on GitHub -
View the final history:
Show me the git log for the main branchYou should see a clean history: the initial commit and the squashed feature commit.
Part 7: Verify Your Work
Run through these final checks:
-
Check the repository status:
Is the repository clean? Any untracked or uncommitted changes? -
Verify on GitHub — open your repository in a web browser and confirm:
- All files are present on the main branch.
- The pull request shows as "Merged."
- The feature branch is deleted.
-
View the commit history on GitHub — click "Commits" to see the full timeline.
Self-Assessment
- Created a Git repository and connected it to GitHub
- Made an initial commit with project files on main
- Created a feature branch (
add-recipe-list) - Made multiple focused commits on the feature branch
- Pushed the branch to GitHub
- Created a pull request with a clear title and description
- Reviewed the PR and addressed feedback from Claude
- (Optional) Created and resolved a merge conflict
- Merged the pull request
- Cleaned up by deleting the feature branch
- Verified the final state on GitHub
If you completed this capstone, you have practiced the exact Git workflow used by professional development teams around the world: branch, develop, commit, push, PR, review, merge. With Claude Code, you can do all of this without memorizing a single Git command. The skills from this module will serve you in every project going forward.
How was this lesson? Take 2 minutes to share your feedback — it helps us make the tutorials better for everyone.