Rana Maninder Singh
Lesson 6 of 8Git & GitHub

Pull Requests, Issues & Team Collaboration

Lesson opener

In one line: Pull request (PR) workflow - industry standard in 2026.

Why it matters: This shows up at work when you need to pull request (PR) workflow - industry standard in 2026.

Before this lesson: GitHub essentials

Before you start

ResourceLink
PreviousGitHub essentials
NextCI/CD & deployment
Time~55 minutes

What you will learn

  • Pull request (PR) workflow — industry standard in 2026
  • Code review basics
  • GitHub Issues for tasks and bugs
  • Branch protection — why you can't push straight to main on real teams

Section 1 — Why pull requests exist

Plain English: A PR says "Please merge my branch into main — here's what changed and why." It enables:


Section 2 — Open your first PR

git switch -c feature/add-license
echo "MIT License" > LICENSE
git add LICENSE
git commit -m "Add MIT license file"
git push -u origin feature/add-license

On GitHub: Compare & pull request → fill template:

## Summary
- Adds MIT LICENSE

## Test plan
- [ ] File renders on repo root

Click Create pull request → Merge pull request → delete branch.

Locally:

git switch main
git pull origin main
git branch -d feature/add-license

Section 3 — Code review etiquette

As author:

As reviewer:


Section 4 — Issues — track work

Create issue: Bug: chart shows wrong Q3 total

Link in commit:

git commit -m "Fix Q3 aggregation — closes #12"

Keywords: fixes #12, closes #12 auto-close issue on merge (if configured).


Section 5 — Branch protection (production repos)

Repo Settings → Branches → Add rule on main:

This is why git push origin main fails on company repos — by design.


Section 6 — gh CLI (2026 power user)

Install: https://cli.github.com

gh auth login
gh repo create my-project --public --source=. --push
gh pr create --title "Add license" --body "Summary here"
gh pr list
gh pr merge 1 --squash

Same workflows from terminal — used in CI and with Cursor.


Practice

  1. Open a PR adding a CONTRIBUTING.md with three bullet rules
  2. Self-review: add one comment on your own PR
  3. Merge and delete the branch

Checklist

  • [ ] Opened and merged at least one PR
  • [ ] Created an Issue linked to a commit
  • [ ] Understand branch protection purpose

Teacher walkthrough: PR as a conversation

All figures illustrative.

Step 1 — Branch + push with a clear name.

Step 2 — Open PR with why, test plan, screenshots if UI.

Step 3 — Review checklist. Correctness, secrets, scope creep.

Step 4 — Merge policy. Squash/merge/rebase per team; delete branch.

Failure example: PR titled "fixes"

Symptom: Reviewers stall; bugs ship; blame unclear.

Diagnosis: No context, no test plan, many unrelated files.

Correction: Small PRs; describe decision; link issue; self-review diff first.

Validation: Reviewer can state the risk in one sentence from the PR body.

Guided practice

List three items you self-check before requesting review.

Complete solution: Diff is only intended files; no secrets; described test plan / how you verified.

Independent practice

Acceptance criteria:

Common mistakes

  1. Mixing refactors with feature changes.
  2. Approving without reading diff.
  3. Merging failing checks "to move on".

What's next

CI/CD & deployment — GitHub Actions, Pages, and shipping from Git.