Skip to main content

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.

Requires GitHub

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

  1. 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.
  2. 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:

  1. 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"
  2. Initialize project memory:

    /init

    Review the CLAUDE.md that gets created and ask Claude to adjust it if needed.

  3. Make the initial commit:

    Commit all files with the message "Initial project setup with HTML, CSS, and JS"
  4. Push to GitHub:

    Push this to the main branch on GitHub
  5. 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:

  1. Create the branch:

    Create a new branch called add-recipe-list
  2. 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.
  3. Review your changes before committing:

    Show me what changed since the last commit
  4. Commit:

    Commit these changes

    Notice the commit message Claude writes — it should describe the recipe list feature.

  5. 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.
  6. Commit again (separate commit for the separate feature):

    Commit these changes
  7. Push the branch:

    Push this branch to GitHub

Part 4: Create a Pull Request

  1. Create the PR:

    Create a pull request for this branch. The title should mention adding
    the recipe list and search functionality.
  2. Read the PR description Claude generates. It should summarize both commits.

  3. Review the PR yourself:

    Review my pull request and give me feedback
  4. 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:

  1. 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.
  2. Switch back to your feature branch:

    Switch to the add-recipe-list branch
  3. Try to merge main into your branch:

    Merge the latest main branch into this branch
  4. Resolve the conflict — if one occurs, work with Claude to resolve it:

    Resolve the conflict by keeping the "Family Recipe Collection" heading
    from main
  5. Push the resolution:

    Push the resolved merge to GitHub

Part 6: Merge the Pull Request

  1. Merge the PR:

    Merge my pull request using squash and merge
  2. Clean up:

    Switch to main, pull the latest changes, and delete the add-recipe-list branch
    both locally and on GitHub
  3. View the final history:

    Show me the git log for the main branch

    You should see a clean history: the initial commit and the squashed feature commit.


Part 7: Verify Your Work

Run through these final checks:

  1. Check the repository status:

    Is the repository clean? Any untracked or uncommitted changes?
  2. 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.
  3. 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
Congratulations

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.


Help Us Improve

How was this lesson? Take 2 minutes to share your feedback — it helps us make the tutorials better for everyone.

Give Feedback →