learn-github-with-phoebe / Session 4 of 6
Learn GitHub with Phoebe · Session 4 of 6 · Non-tech track

Branches + pull requests: the flow that kills final_v3_FINAL.docx

This is the heart of the course. Today you learn the collaboration move GitHub exports to the whole working world: draft in a safe copy, propose the change, discuss it line by line, accept it with one click - and keep the full story forever. Browser only, as always. By the end of the hour you will have done both sides of the flow: author and reviewer.

🟡 Core Non-tech professionals Browser only 45 min live + self-study
0-3 · Welcome 3-18 · Concepts 18-40 · Apply-along 40-45 · Q&A
Part 0

Why this session is the whole point

Every team has lived the horror story: final.docx, final_v2.docx, final_v3_FINAL.docx, and nobody knows which one the boss approved. Sessions 1-3 gave you a repo, a README and a task board. Today those become a real collaboration system: branches (safe copies), pull requests (proposals with a conversation), and reviews (comment, suggest, approve). One flow replaces the email attachment forever - and it works on your handbook exactly as it works on the world's biggest software.

Live - presented in session Self-study - read after class ★ Apply-along - in your browser, everyone does it Running artifact: your own handbook repo
★ What you walk out with today The full branch → pull request → review → merge loop, done with your own hands on your own handbook - plus the reviewer superpowers (line comments and one-click suggestions) and the purple Merged badge to prove it. This is the single most valuable pattern GitHub will ever teach you.
Part 1 · safe copies

Branches: safe copies 4 min live

A branch is a parallel copy of the whole repo where you can work freely without touching the real thing. The real thing has a name: main - the published truth everyone reads. Your branch is your draft desk; nothing you do there changes main until the team accepts it.

Merged main = the published truth your branch = your draft clarify-expense-policy each dot = a commit merge = draft accepted main updated, history kept Main never wobbles while you draft. Readers keep seeing the published truth until the moment the merge lands.
🔍 Click to zoom - the classic railway diagram, in office terms
LiveYou never have to create a branch on purpose2 min▶

Here is the friendly secret: the web editor offers the branch to you. Open a file, click the pencil ✏️, make your edit, press Commit changes - and if you should not be writing to main directly, GitHub shows a radio button: "Create a new branch for this commit and start a pull request." Pick it, and the safe copy plus the proposal appear together. No ceremony.

  • Name the branch after the change: clarify-expense-policy, fix-onboarding-typo, add-travel-section. Future readers (including future you) thank present you.
  • One branch, one topic. A branch that changes ten unrelated things is as unreviewable as an email titled "misc updates".
  • Branches are cheap and disposable. Make one for a two-word edit. After the merge it gets deleted and nothing of value is lost - the history moved into main.
The office translation A branch is "let me take a copy home and mark it up" - except the copy can never drift out of date silently, and handing it back is a one-click, fully tracked event instead of an attachment.
Self-studyWhere branches live, and how they end2 min read▶
  • Seeing them: the branch dropdown at the top-left of the Code tab (it usually says "main") lists every branch in the repo. Click one to browse the repo as that draft sees it - a whole parallel world, one click away.
  • Branches end one of two ways: merged (the purple badge - the draft became truth) or deleted unmerged (the proposal was declined, main untouched). Both endings are safe; neither loses history that reached main.
  • Stale branches - drafts someone opened and forgot - are the repo's junk drawer. Deleting a merged branch is always safe; ask before deleting an unmerged one, exactly as you would before binning a colleague's marked-up printout.
Part 2 · proposals with a conversation

Pull requests: proposals with a conversation 6 min live

A pull request (PR) says: "here is my branch - compare it to main, discuss, then accept." It is a proposal, a track-changes view, and a meeting thread fused into one page. Nothing changes on main while the PR is open; declining it harms nothing.

Clarify expense policy #12 Open 1 Files changed - the diff - reimburse within 60 days + repay within 30 days 2 Conversation Maria: tiny suggestion on line 12 You: good catch - committed! 3 Reviewers Maria ✓ approved Merge pull request Merged 5 4 1 · Title says the intent 2 · The diff: red = removed, green = added 3 · Conversation stays attached forever 4 · Reviewers approve 5 · Merge, then the purple badge for keeps
🔍 Click to zoom - the five zones of every pull request page
LiveThe diff is the world's best track-changes3 min▶
  • Red lines = removed, green lines = added. A changed sentence shows as one red line (the old) plus one green line (the new). Reviewers see exactly what would change - never a wall of maybe-different text.
  • The Conversation tab collects every comment, decision and "why we did this" - attached to the change forever. Six months later, the reasoning is one click away instead of buried in someone's inbox.
  • Draft PRs say "not ready yet - look, but do not review formally". Perfect for work in progress you want visible early.
  • Closing without merging = proposal declined. Main never changed, the branch can be deleted, and the discussion stays on record. Saying no is safe, cheap and polite here.
Real world

GitLab's public handbook is the famous proof: thousands of employees, and every policy change - salary formulas, parental leave, meeting norms - lands as a pull request reviewed in the open. HR people and lawyers open PRs daily; almost none of them code. And closer to home: the pages of this very course ship via pull requests, one session per proposal.

Part 3 · comment, suggest, approve

Reviews: comment, suggest, approve 5 min live

A reviewer opens Files changed, reads the red and green, and has four moves: comment on any line, suggest an exact replacement, request changes, or approve. The suggestion is the showstopper - the author accepts the reviewer's exact fix with one click.

LiveThe four reviewer moves, and who presses merge3 min▶
  • Comment: attach a note to one specific line. No more "in the third paragraph on page 2, I think...". The line itself carries the discussion.
  • Suggest: the ± icon in the comment box lets you type the exact replacement text. The author sees your version rendered as its own mini diff and clicks Commit suggestion - your fix lands, attributed to both of you, no retyping. This one button converts vague feedback into finished work.
  • Request changes: the formal "not yet" - the PR shows a visible block until concerns are resolved.
  • Approve: the formal thumbs-up. Convention: the author merges after approval - reviewers advise, the proposer ships.

Then the merge: one green button, the badge flips to purple Merged, the branch gets deleted, main is updated, and every commit and comment is preserved in the history. The draft became the published truth, with a paper trail.

The habit that transfers Line-level suggestions are the skill colleagues will notice first. "Here is the exact sentence I would use instead" beats "this section feels off" in every medium - GitHub just made it a button.
Self-studyMerge conflicts + branch protection, in one screen3 min read▶

Merge conflicts, one paragraph: if two people edit the same line of the same file on different branches, GitHub cannot guess which version wins - so it shows both, marked clearly, and asks a human to pick. The web UI has a built-in editor that handles simple cases in a minute (choose one version, or blend them, then confirm). Genuinely gnarly conflicts are tech-track territory; your defense in a docs repo is simply small PRs merged promptly, which makes collisions rare.

Branch protection: Settings → Branches → add a rule on main requiring 1 approving review before merge. That single setting turns review from a favor into a rule - nobody, including the repo owner on a rushed Friday, can push straight to the published truth. It is this week's homework for a reason.

Apply-along 1 of 3

The full loop, solo ★ 8 min · everyone merges

The whole superpower in 8 minutes: one edit travels branch → PR → diff → merge, and you press every button yourself.

Open your handbook repo's README and click the pencil ✏️. Change one sentence - improve a wording, fix a phrase, anything real.

Press Commit changes, and this time choose "Create a new branch for this commit and start a pull request." Name the branch after the change (improve-readme-intro), then Propose changes.

On the Open a pull request screen, write a one-line description of why, and click Create pull request. You now have a live proposal.

Click Files changed and read your diff: the old sentence in red, yours in green. This is what a reviewer would see.

Back on Conversation, press Merge pull request → Confirm merge → Delete branch. Watch the badge turn purple Merged. Check the README on main: your sentence is the published truth, and the PR page is its permanent receipt.

Apply-along 2 of 3

Pair review: both sides of the flow ★ 8 min · in pairs

Author and reviewer are two different feelings - have both today. Pair up with a neighbor (solo attendees: use the presenter's demo repo, invitation link in the room chat).

Partner A opens a PR on their handbook changing one line (same moves as Apply-along 1), and adds Partner B as a collaborator if needed (Settings → Collaborators).

Partner B opens the PR → Files changed, hovers a line, clicks the blue +, and leaves one comment ("love this because...").

Still B: on another line (or the same one), click the ± suggestion icon and type an exact replacement wording. Submit the review.

Partner A opens the suggestion and clicks Commit suggestion. One click - B's exact fix just landed on A's branch, no retyping. Feel that.

B approves (Review changes → Approve). A merges. Purple badge. Everyone in the room has now been both author and reviewer - the complete collaboration loop.

The debrief Notice the suggestion moment: feedback became finished work with one click, fully attributed to both people. That is the button that makes GitHub review kinder AND faster than comments in the margin.
Apply-along 3 of 3

Which step of the journey is this? ★ 6 min · everyone sorts

Six moments from a handbook change. Place each one on the branch → commit → PR → review → merge journey.

The debrief The sneaky one is the typo fix: it is a commit, not a new pull request. New saves on the branch flow into the open proposal automatically - you never start over because a reviewer caught something. That is the flow forgiving you by design.
After the session

This week ◐ 25 min total

Check yourself

Three questions before you go 🎯 ◐ 90 seconds

1 · What actually happens when a pull request is merged?

Merge = draft accepted into the published truth, with the paper trail kept forever. Nothing is lost; the branch itself can be safely deleted because its story moved into main.

2 · A reviewer leaves a suggestion on line 12. What does that let the author do?

The suggestion carries the exact fix; Commit suggestion lands it on the branch instantly, credited to both people. Feedback becomes finished work with one click.

3 · In a pull request diff, what do the red and green lines mean?

A changed sentence shows as its old self in red plus its new self in green - the world's best track-changes, and the thing reviewers actually read.

Source material

Official GitHub Skills coverage

This course maps to GitHub's own free Skills exercises - each session tells you honestly what is covered here and what the official course adds.

✓Review pull requests (skills/review-pull-requests)the full review flow - comment, suggest, request changes, approve, merge - Parts 2-3 + Apply-along 2
✓Introduction to GitHub - branch + PR loopthe branch → PR → merge cycle via the web editor - Part 1 + Apply-along 1
◐Resolve merge conflicts (skills/resolve-merge-conflicts)concept only in the self-study card - the tech track does the driving
◐Branch protection rulesthe require-1-review setting, self-study + homework; deeper rulesets are tech track

Session 4 cheat sheet · pin this

BranchA parallel copy of the repo for drafting. Main = the published truth. Name branches after the change.
Pull request"Here is my branch - compare, discuss, accept." Proposal + track-changes + meeting thread in one page.
The diffFiles changed tab. Red = removed, green = added. Read your own before merging.
Reviewer movesComment on a line · suggest an exact fix (author clicks Commit suggestion) · request changes · approve.
MergeAuthor merges after approval. Purple Merged badge, branch deleted, main updated, history kept.
"closes #N"Put it in the PR description and the merge auto-closes issue N. Work and task, linked forever.