Capstone team project
Overview
You’ve learned the pieces: commits and branches, undoing and rewriting, remotes, pull requests, reviews, workflows, automation and recovery. In this capstone you’ll put them together the way a real team does, and finish with a repository you can show employers.
You can do it alone (playing both roles from two clones, or two GitHub accounts) — but it’s much better with a friend or classmate. The exercise below rehearses the Git side offline first; then follow the steps on GitHub.
The project
Build a small website together — a team page, a recipe collection or a “links I recommend” page. The content doesn’t matter; the process does. Plain HTML and CSS is enough.
Phase 1: Set up (one person)
- Create the repository on GitHub, public, with a README, an MIT licence and a
.gitignore:gh repo create team-site --public --clone --add-readme --license mit --gitignore Node. - Invite your teammate as a collaborator (Settings → Collaborators).
- Add project files on a branch and through a PR — even setup goes through review:
.github/pull_request_template.md(Pull requests),.github/ISSUE_TEMPLATE/bug_report.yml(Issues and projects),.github/CODEOWNERSwith both of you (Reviewing code),.github/workflows/ci.yml— a simple check, for example an HTML validator or link checker, or a script that confirmsindex.htmlexists (Continuous integration).
- Protect
mainwith a ruleset: require a PR, one approval, the CI check passing, and block force pushes and deletion (Protecting branches). - Enable squash merging only, auto-merge and automatically delete head branches (Settings → General).
Phase 2: Plan
- Create a Project board with Todo / In progress / In review / Done.
- Write at least six issues — pages, sections, styling, an accessibility check — with labels. Make sure two issues touch the same file (both edit the page heading, say), so you’ll get a real conflict.
- Split them between you and assign.
Phase 3: Build together
For each issue, follow GitHub flow:
gh issue develop <n> --checkout— a linked branch.- Small commits with good messages (Conventional Commits if you like).
- Push, open a PR with the template filled in and
Fixes #n. - Review each other’s PRs properly: run them, comment on lines, use at least one suggestion, request changes at least once.
- Address feedback with new commits; tidy with interactive rebase if needed.
- Merge when green and approved.
The conflict
When the two heading PRs collide, the second one shows “This branch has conflicts that must be resolved”. Resolve it on the feature branch, never on main:
git switch feature/brand
git fetch
git rebase origin/main # fix the conflict, git add, git rebase --continue
git push --force-with-leaseRequest a fresh review if the resolution changed anything meaningful.
Phase 4: Ship
- When the issues are done, tag a release:
git tag -a v1.0.0 -m "Version 1.0.0"andgit push origin v1.0.0— or add the release workflow from Tags and releases. - Publish a GitHub Release with generated notes:
gh release create v1.0.0 --generate-notes. - Optionally publish the site with GitHub Pages (Settings → Pages → Deploy from branch
main).
Checklist: what “done” looks like
- README explains the project and how to run it; licence present
-
mainprotected: PR + approval + CI required, no force pushes - every change arrived through a reviewed PR linked to an issue
- at least one conflict resolved on a feature branch
- CI runs on every PR and is green on
main - clean, readable history on
main(git log --onelinetells the story) -
v1.0.0tag and a GitHub Release with notes - no secrets anywhere in the history
Reflect
Look back at the history with git log --oneline --graph, the closed PRs and the project board. Notice how every line of code can be traced to a commit, a PR, a review and an issue explaining why it exists. That traceability is what makes Git and GitHub so valuable to teams.
Where to go next
- Contribute to open source: find a
good first issuein a project you use and make your first fork-and-PR contribution. - Automate more: deploy previews, Dependabot, release automation from Conventional Commits.
- Go deeper into Git: the free book Pro Git at git-scm.com covers internals, server setup and advanced tools.
- Keep an eye on Git 3.0 (planned for 2027):
mainby default, SHA-256 object IDs and the reftable ref format. Nothing in your daily workflow changes.
Congratulations! You now work with Git and GitHub the way professional teams do: small commits, short-lived branches, reviewed pull requests, automated checks, safe undo — and the confidence to recover from anything.
Rehearse the whole workflow locally
Before doing the capstone on GitHub, rehearse its Git side offline with a local bare repository as the server and two developers. Set up the repository with a README, .gitignore, PR template, CI workflow and CODEOWNERS; protect main on the server against force pushes and deletion. Asha and Ben each build a feature on a branch — both change the same line of index.html. Merge Asha’s first, then have Ben rebase, resolve the conflict and merge his. Squash-merge style: each feature lands on main as one commit. Tag v1.0.0 and push it. End with a linear history of three commits and the tag on the server.
git init -q --bare -b main server.git
# 1. Asha sets up the repository (README, .gitignore, PR template, CI, CODEOWNERS) and pushes
# 2. Protect main on the "server"
# 3. Ben clones; both start a feature branch
# 4. Asha's feature lands first (squash-merge)
# 5. Ben rebases, resolves the conflict, his feature lands (squash-merge)
# 6. Tag and push v1.0.0git init -q --bare -b main server.git
# 1. Asha sets up the repository (README, .gitignore, PR template, CI, CODEOWNERS) and pushes
git clone -q server.git asha 2>/dev/null && cd asha
printf "# Team Site\n\nA practice project for the Git & GitHub course.\n" > README.md
printf "node_modules/\n.env\n*.log\n" > .gitignore
echo "<h1>Team Site</h1>" > index.html
mkdir -p .github/workflows
printf "## What\n\n## Why\n\n## How to test\n" > .github/pull_request_template.md
printf "* @asha @ben\n" > .github/CODEOWNERS
cat > .github/workflows/ci.yml <<'EOF'
name: CI
on: [pull_request]
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: test -f index.html
EOF
git add . && git commit -qm "chore: set up repository"
git push -qu origin main
cd ..
# 2. Protect main on the "server" (on GitHub: a ruleset).
# receive.deny* settings would apply to EVERY branch, so use a pre-receive
# hook that only guards main: no deletion, no force pushes.
cat > server.git/hooks/pre-receive <<'EOF'
#!/bin/sh
zero=$(git hash-object --stdin </dev/null | tr '0-9a-f' '0')
while read -r old new ref; do
[ "$ref" = refs/heads/main ] || continue
if [ "$new" = "$zero" ]; then echo "main cannot be deleted" >&2; exit 1; fi
if [ "$old" != "$zero" ] && ! git merge-base --is-ancestor "$old" "$new"; then
echo "force pushes to main are not allowed" >&2; exit 1
fi
done
EOF
chmod +x server.git/hooks/pre-receive
# 3. Ben clones; both start a feature branch
git clone -q server.git ben
(cd asha && git switch -qc feature/hero \
&& echo "<h1>Welcome to Team Site</h1>" > index.html && git commit -qam "Add welcome heading" \
&& echo "<p>We build things.</p>" >> index.html && git commit -qam "Add tagline" \
&& git push -qu origin feature/hero)
(cd ben && git switch -qc feature/brand \
&& echo "<h1>Team Site — Est. 2026</h1>" > index.html && git commit -qam "Add founding year" \
&& git push -qu origin feature/brand)
# 4. Asha's feature lands first (what "Squash and merge" does)
cd asha && git switch -q main && git pull -q
git merge --squash -q feature/hero && git commit -qm "feat: add welcome heading and tagline (#1)"
git push -q && git push -q origin --delete feature/hero
cd ..
# 5. Ben rebases, resolves the conflict, his feature lands
cd ben && git fetch -q
git rebase origin/main || true # CONFLICT in index.html
printf "<h1>Welcome to Team Site — Est. 2026</h1>\n<p>We build things.</p>\n" > index.html
git add index.html && GIT_EDITOR=true git rebase --continue
git push -q --force-with-lease # his own branch: allowed
git switch -q main && git pull -q
git merge --squash -q feature/brand && git commit -qm "feat: add founding year to heading (#2)"
git push -q && git push -q origin --delete feature/brand
# 6. Tag and push v1.0.0
git tag -a v1.0.0 -m "Version 1.0.0"
git push -q origin v1.0.0
git log --oneline --graph
# Check the protection: rewriting main is refused by the server
git commit -q --amend -m "rewrite main" && git push -q --force 2>/dev/null && echo "UNEXPECTED" || echo "force push to main rejected ✓"
git reset -q --hard origin/mainSummary
- A professional repository starts with a README, licence, .gitignore, templates, CI and protected main.
- All work flows through issues, short-lived branches and reviewed pull requests.
- Conflicts are resolved on the feature branch — by rebasing or merging main — never on main.
- Squash merging gives one clean commit per pull request on main.
- Ship with an annotated tag and a GitHub Release with generated notes.