Teamwork & Code Reviews 45 min interactive guide🚀 Role-Playing Team Workflow Simulator

Git Collaboration: Team Workflows & Code Reviews

Master collaborative software development with Git & GitHub. Learn forks vs clones, feature branch workflows, opening PRs, navigating code reviews, resolving requested changes, linking issues (Closes #24), branch protection rules, and team best practices inside a live role-playing simulator.

01

1. What Is Collaborative Development?

Collaborative software developmentis the process where multiple software engineers write, review, test, and integrate code into a single shared codebase without overwriting each other's work.

💡 Core Mental Model: Issue ➔ Branch ➔ Code ➔ Commit ➔ Push ➔ Pull Request ➔ Review ➔ Changes ➔ Approval ➔ Merge.
02

2. How Developers Work Together With Git

1. Shared Repo Model

Small-to-medium teams push branches directly to the central company repository and open PRs.

2. Fork & Pull Model

Open-source contributors fork their own copy and submit PRs back to the upstream repo.

3. Automated CI Gates

GitHub Actions automatically run tests and linters before anyone is allowed to merge.

03

3. Forks and Cloning (Upstream vs Origin)

ConceptWhere It LivesPurpose
UpstreamOriginal organization GitHub repoCanonical source of truth (read-only for outside contributors)
Origin (Fork)Your personal GitHub accountYour cloud copy where you have write access to push branches
Local CloneYour personal laptop / PCWhere you edit code, run local dev servers, and make commits
04

4. Feature Branch Workflow

Always branch off the latest main with a standard naming convention:

# 1. Pull latest main
git switch main && git pull origin main

# 2. Create feature branch
git switch -c feat/user-authentication

# 3. Work, test, commit atomically
git add .
git commit -m "feat(auth): implement JWT token storage"

# 4. Push to remote
git push -u origin feat/user-authentication
05

5. Pull Requests (PR Lifecycle)

A Pull Requestis not just code; it's a technical proposal. Write clear PR descriptions:

## Summary of Changes
- Added user authentication modal with email validation.
- Integrated Supabase Auth client.

## Related Issue
Closes #24

## How to Test
1. Open `/login` ➔ click "Sign in with Email" ➔ verify toast feedback.
06

6. Code Reviews: Reviewing & Handling Feedback

Approve (LGTM)

Code is clean, tested, and ready to merge into production.

Comment / Question

Non-blocking feedback or questions about architecture decisions.

Request Changes

Blocks merge until critical bugs, security issues, or missing tests are resolved.

07

7. Handling Collaboration Conflicts

When teammates merge their PRs first, your branch might fall behind. Keep your branch synced:

# Sync your local feature branch with teammate changes on main
git switch main
git pull origin main
git switch feat/my-work
git merge main
# (Resolve any conflicts if prompted, then git commit && git push)
08

8. Issues, Labels & Auto-Closing (Closes #24)

Using keywords like Closes #24, Fixes #10, or Resolves #102 in your PR description tells GitHub to automatically move and close the associated issue when the PR merges.

09

9. Permissions & Protected Branches

In production teams, repository admins protect the main branch with rules:

  • Require at least 1 or 2 approved peer reviews.
  • Require all automated CI test suites to pass.
  • Require linear commit history (Squash and Merge).
  • Disable force-pushes (git push --force).
10

10. A Complete Team Workflow Summary

1. Issue #24 assigned ➔ Status: In Progress
2. git switch -c fix/24-nav-overflow
3. Code ➔ test ➔ git commit -m "fix(nav): resolve mobile overflow (#24)"
4. git push -u origin fix/24-nav-overflow
5. Open PR: "Fix mobile navigation overflow (Closes #24)"
6. CI runs test suite (Green ✓)
7. Senior Reviewer leaves feedback ➔ Update branch ➔ Approved ✓
8. Squash and Merge ➔ Issue #24 auto-closes ➔ Deploy to production!
11

11. Common Collaboration Mistakes

  • Ghosting code reviews: Respond to review comments promptly with explanations or fixes.
  • Giant PRs with 50 changed files: Split large features into smaller, reviewable PRs (< 300 lines).
  • Taking feedback personally: Code reviews critique the code, not the engineer. It is how developers grow together.
12

12. Collaboration Best Practices

  • Write clear, helpful PR descriptions with before/after screenshots for UI changes.
  • Delete merged feature branches to keep the repository uncluttered.
  • Use Conventional Commits (feat:, fix:, docs:, refactor:).
LIVE INTERACTIVE LAB

Team Git Workflow Simulator

Step into the shoes of a software engineer! Solve real team scenarios: claim Issue #24, create feature branches, commit atomically, open a PR, handle reviewer feedback, and merge into production!

Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
1. Issue Backlog: Claiming Work

You check the team project board and see Issue #24: 'Fix mobile navigation drawer overflow on iOS Safari'. What should you do first?

TEAM GIT CLI LOG:
$ git status
On branch main. Team repository: pathubs-team/production-app
Issue #24: 'Fix mobile navigation drawer overflow' ready in backlog.
🎯 Team Challenge 1 of 7❌ Try Again

Goal 1: Claim Issue #24 from the team backlog.

TEST YOUR KNOWLEDGE

Git Collaboration & Team Workflow Mastery Quiz

8 scenario-based questions testing your understanding of forks vs clones, Pull Requests, Code Reviews, addressing requested changes, linking issues, and protected branches.

Question 1 of 8Score: 0 / 8
🍴 What is the technical difference between a Fork and a Clone in Git?