-
Notifications
You must be signed in to change notification settings - Fork 4
12 github pull requests extension
Listen to Episode 13: The GitHub Pull Requests Extension - a conversational audio overview of this chapter. Listen before reading to preview the concepts, or after to reinforce what you learned.
Day 2, Block 2 Material
This guide covers the GitHub Pull Requests and Issues extension: viewing open PRs, checking out PR branches for local testing, reviewing PRs with screen reader-accessible tools, creating PRs directly from VS Code, using PR templates, and syncing PR status with GitHub.
Prerequisites: Working with Pull Requests, Git & Source Control in VS Code
Mac keyboard shortcuts: Throughout this chapter, all
Ctrl+shortcuts useCmd+on Mac, andAlt+shortcuts useOption+on Mac. For example:Ctrl+Shift+P→Cmd+Shift+P,Ctrl+Shift+G→Cmd+Shift+G,Alt+F2→Option+F2. Context menus (Shift+F10on Windows) useCtrl+Returnon Mac.
Chapter 12 introduces the GitHub Pull Requests extension for managing PRs directly from VS Code.
- Challenge count: 2 guided challenges
- Automation check: none (extension installation and review state are account-local)
- Evidence: issue comment with confirmation of actions completed
- Pattern: install -> check out -> review
For this workshop, Chapter 12 focuses on tooling setup and PR review workflow:
Estimated time: 15-25 minutes
-
Install the GitHub Pull Requests extension
- Add the extension to VS Code and sign in with your GitHub account.
-
Check out a challenge PR and post a review
- Download a PR branch locally and write one constructive review comment.
- If checkout is blocked by permissions, complete the challenge in read-only mode by reviewing the PR and posting one specific comment.
- Student can install and authenticate the GitHub PR extension.
- Student can check out a PR branch in VS Code.
- Student can interactively review changes and post feedback.
- If extension doesn't install, reload VS Code with
Ctrl+Shift+P→ "Developer: Reload Window". - If OAuth sign-in fails, verify your GitHub account is active in the browser first, then retry.
- If PR list is empty, switch to "All Open" view in the GitHub section of Explorer.
- If checkout fails, confirm you have write access to the repository or ask facilitator.
- Ask facilitator to verify the GitHub PR view in Explorer and help with one checkout.
- If Activity Bar focus is difficult with a screen reader, use Command Palette and run
GitHub Pull Requests: Focus on Pull Requests View.
PR tooling multiplies your impact. Reviewing others' work refines your own standards and builds community trust.
- Installing the GitHub Pull Requests Extension
- Viewing Pull Requests
- Checking Out a Pull Request Branch
- Reviewing Pull Requests in VS Code
- Creating a Pull Request from VS Code
- Pull Request Description Templates
- Commenting and Requesting Changes
- Merging Pull Requests
The GitHub Pull Requests and Issues extension integrates GitHub's PR workflow directly into VS Code - no browser tab switching required.
- Open Extensions sidebar:
Ctrl+Shift+X(Mac:Cmd+Shift+X) - Type "GitHub Pull Requests" in the search box
- Find "GitHub Pull Requests and Issues" (publisher: GitHub)
- Navigate to the extension in the results list
- Press
Enterto open the extension detail page -
Tabto "Install" button → pressEnter
Ctrl+Shift+P- Type "install extensions"
- Select "Extensions: Install Extensions"
- Search for "GitHub Pull Requests"
- Install "GitHub Pull Requests and Issues"
Screen reader note: The Extensions sidebar is a tree view. Use Up/Down Arrow to navigate, Enter to open an extension's detail page.
After installation, VS Code prompts you to sign in:
- A notification appears: "Sign in to GitHub to use Pull Requests"
- Navigate to the notification (
Alt+N/ Mac:Option+N, or status bar navigation) - Select "Sign in"
- VS Code opens your browser for GitHub OAuth authentication
- Authorize VS Code in the browser
- Return to VS Code - you're now signed in
- Open Command Palette:
Ctrl+Shift+P(Mac:Cmd+Shift+P) - Type "GitHub Pull Requests: Sign in"
- If already signed in, the option shows "Sign out" instead
After installation, you gain:
- GitHub view in the Activity Bar (sidebar icon that looks like the GitHub logo)
- Pull Requests and Issues tree in the Explorer
- PR creation commands in the Command Palette
- Inline PR review features in the editor
- Issue linking when writing commit messages
Visual / mouse users
Click the GitHub logo icon in the Activity Bar (the vertical strip of icons on the far left). It's usually the 5th or 6th icon. The GitHub Pull Requests panel opens.
Screen reader users (NVDA / JAWS / VoiceOver)
- The Activity Bar is not always reachable by
Tabfrom the editor - Use
Ctrl+Shift+P(Mac:Cmd+Shift+P) → type "GitHub Pull Requests: View Pull Request" or "Focus on Pull Requests View" → pressEnter - Alternatively press
Ctrl+Shift+G(Mac:Cmd+Shift+G) to open Source Control, thenTabuntil you reach the Activity Bar icon strip
The GitHub view opens, showing:
- "Pull Requests"
- "Issues"
Web alternative (github.com)
View pull requests directly on GitHub without VS Code:
- Navigate to the repository on GitHub.com
- Click the Pull requests tab
- Click any PR title to view its conversation, commits, and changed files
- Use the Files changed tab to review diffs
See Working with Pull Requests for the full web-based PR workflow.
GitHub CLI (gh) alternative
View PRs from your terminal:
# List open PRs
gh pr list
# View a specific PR
gh pr view 42
# Open a PR in your browser
gh pr view 42 --web
# Filter PRs waiting for your review
gh pr list --search "review-requested:@me"- Open Explorer:
Ctrl+Shift+E(Mac:Cmd+Shift+E) - Navigate with
Arrowkeys to find the "GitHub Pull Requests" section - Expand it with
Right Arrow
The GitHub Pull Requests panel has two top-level sections. "My Pull Requests" contains four filters: Assigned to Me, Created by Me, Waiting for my Review, and All Open. The repository section shows Local Pull Request Branches (checked out locally), All Open Pull Requests, and All Closed Pull Requests.
"Pull Request #42: Add Timeline Guide, opened by jeffb, 2 days ago, 3 files changed"
- "All Open" - every open PR
- "Assigned to Me" - PRs where you're an assignee
- "Waiting for my Review" - PRs where you're requested as reviewer
- "Draft" - PRs marked as work-in-progress
The tree organizes PRs by repository. Expand a repo to see its PRs.
- Navigate to a PR in the tree
- Press
Enter
A PR detail view opens in the editor area showing:
- PR title and number
- Author and creation date
- Status (Open, Merged, Closed)
- Description (full Markdown with inline rendering)
- Reviewers and their status (Approved, Requested Changes, Pending)
- Checks (CI status: passing, failing, pending)
- Files changed (clickable list)
- Comments timeline
- The detail view is Markdown-rendered HTML
- Use standard screen reader reading commands (
Arrowkeys in NVDA/JAWS virtual mode) - Headings mark each section ("Description", "Reviewers", "Files Changed", "Comments")
- Links are clickable with
Enter
Checking out a PR means downloading its branch to your local machine so you can test it, review it interactively, or add commits to it.
- Test functionality: Run the code locally to verify it works
- Review with full context: See the changes in your editor with full file access
- Make suggestions: Add commits to someone else's PR (if you have write access)
- Verify accessibility: Test with your screen reader to ensure changes don't break navigation
- Open a PR (see Section 2)
- In the PR detail view, navigate to "Checkout" button
- Press
Enter
VS Code:
- Downloads the branch
- Switches your local repository to that branch
- Opens the changed files in the editor
- Navigate to the PR in the GitHub Pull Requests tree
- Press
Shift+F10(Mac:Ctrl+Return) to open context menu - Select "Checkout Pull Request"
-
Ctrl+Shift+P(Mac:Cmd+Shift+P) - Type "GitHub Pull Requests: Checkout"
- Select "GitHub Pull Requests: Checkout Pull Request"
- Choose the PR from the list
Screen reader note: After checkout, the bottom-left status bar shows the branch name (example: "jeffb/add-timeline-guide"). Your local files now match that branch.
After reviewing:
-
Ctrl+Shift+P(Mac:Cmd+Shift+P) - Type "git checkout"
- Select "Git: Checkout to..."
- Choose your original branch (usually
mainor your feature branch)
Once you've checked out a PR (or opened it in the detail view), you can review its changes fully within VS Code.
- Scroll down to "Files Changed" section
- Each file is a link
- Navigate with
Arrowkeys - Press
Enteron a file to open its diff view
"docs/11-vscode-basics.md, 42 additions, 3 deletions"
When you open a file from "Files Changed":
- Left side: original file (before changes)
- Right side: modified file (after changes)
- Changed lines highlighted (added = green, removed = red)
- Single editor
- Removed lines shown with
-prefix - Added lines shown with
+prefix
- Command Palette:
Ctrl+Shift+P(Mac:Cmd+Shift+P) → "Diff: Toggle Inline View"
- Open a changed file from the PR detail view
- Press
F7to jump to the first diff hunk - Press
Alt+F2(Mac:Option+F2) to open Accessible View - Read the hunk content:
- Unchanged lines (for context)
- Removed lines (prefixed with
-) - Added lines (prefixed with
+)
- Press
Escapeto close Accessible View - Press
F7to jump to the next hunk - Repeat until all hunks reviewed
Hunk 1 of 3 - lines 12 to 18
Unchanged: ## VS Code Setup
- Removed: This guide covers VS Code basics.
+ Added: This guide covers VS Code basics and accessibility features.
Unchanged:
Unchanged: **Prerequisites:** Day 1 completion
VS Code October 2025 update: Deleted lines (shown with the
-prefix) are now fully selectable and copyable in the diff editor. Previously, deleted code could only be read, not selected. This is useful when you want to copy a deleted function signature, old variable name, or removed text for reference while writing your review comment.
As you review, note any problems:
- Navigate to the specific line in the diff
- Press
Shift+F10(Mac:Ctrl+Return) for context menu - Select "Add Comment"
- Type your comment in the input that appears
- Choose "Single Comment" or "Start Review"
Single Comment posts immediately.
Start Review saves your comments as a draft until you submit the full review (see Section 7).
After you've pushed commits to a feature branch, you can create a PR without leaving VS Code.
- You've created a branch (see Git & Source Control: Branch Management)
- You've made commits
- You've pushed the branch to GitHub (
Ctrl+Shift+P/ Mac:Cmd+Shift+P→ "Git: Push")
-
Ctrl+Shift+P(Mac:Cmd+Shift+P) - Type "GitHub Pull Requests: Create"
- Select "GitHub Pull Requests: Create Pull Request"
- A form opens in the editor
- Open Source Control:
Ctrl+Shift+G(Mac:Cmd+Shift+G) - After pushing, a "Create Pull Request" button appears
- Press
Enteron that button
- Open GitHub view (Activity Bar → GitHub icon)
- Right-click your branch in the tree
- Select "Create Pull Request"
The form has these fields:
- Auto-filled with your most recent commit message
- Edit to make it descriptive (example: "Add Timeline View documentation")
- Explain what changed and why
- Reference the issue you're fixing: "Fixes #42"
- If a PR template exists, VS Code loads it here (see Section 6)
- Copilot-assisted description: An AI sparkle icon in the description toolbar lets you generate a description from your commits. When a PR template exists, Copilot fills in the template sections intelligently rather than replacing the template - it populates the checklist items and description sections with content derived from your changes.
- Usually
mainordevelop - This is the branch your changes will merge into
- Your feature branch (auto-selected)
- This is the branch with your changes
- Select people to review your PR
- Navigate the list with
Arrowkeys
- Add labels like
documentation,accessibility,good-first-issue
- Link the PR to a project milestone
- Check this if the PR is not ready for review yet
- Unchecked = "Ready for review"
- All fields are standard form inputs
-
Tabto move between fields - Use
Arrowkeys in dropdowns (reviewers, labels, milestones)
- Review all fields
-
Tabto "Create" button - Press
Enter
VS Code creates the PR on GitHub and shows a success message. The PR link appears in the notification - click it to open the PR on GitHub, or open it in the GitHub Pull Requests panel.
Web alternative (github.com) - creating a PR
Create a PR from your browser after pushing your branch:
- Navigate to the repository on GitHub
- If you recently pushed, a yellow banner "Compare & pull request" appears - click it
- Otherwise: click Pull requests tab, then New pull request, then select your branch
- Fill in the title and description
- Click Create pull request
See Working with Pull Requests - Opening a PR for detailed screen reader steps.
GitHub CLI (gh) alternative - creating a PR
# Interactive: prompts for title, body, base branch
gh pr create
# Inline: provide details directly
gh pr create --title "Add Timeline View documentation" --body "Fixes #42"
# Create as draft
gh pr create --draft
# Open the form in your browser
gh pr create --webMany repositories include a PR template - a Markdown file that pre-fills the PR description with a checklist or structure.
Common locations:
-
.github/pull_request_template.md(root) .github/PULL_REQUEST_TEMPLATE.md-
.github/PULL_REQUEST_TEMPLATE/(folder with multiple templates) docs/pull_request_template.md
When you create a PR in VS Code, the extension automatically loads the template into the description field.
## Description
<!-- Briefly describe what this PR changes and why -->
## Related Issue
<!-- Link to the issue this PR fixes: Fixes #123 -->
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Accessibility improvement
## Testing
<!-- How did you test these changes? -->
## Checklist
- [ ] My code follows the project's style guidelines
- [ ] I have tested with a screen reader (NVDA, JAWS, or VoiceOver)
- [ ] I have updated the documentation
- [ ] All new and existing tests pass
- [ ] I have linked this PR to the related issue
## Screenshots (if applicable)
<!-- Add screenshots or screen recordings -->- Create PR (Method 1-3 from Section 5)
- The description field is pre-filled with the template
- Navigate through the template with
Arrowkeys - Replace each
<!-- comment -->with your content - Check checkboxes by typing
xbetween the brackets:- [x]
Keyboard tip: Use Ctrl+F (Mac: Cmd+F) to jump to each <!-- placeholder, fill it in, then F3 to jump to the next one.
When reviewing a PR, you can:
- Leave inline comments on specific lines
- Request changes before the PR can be merged
- Approve the PR
- Submit general feedback
- Open a file from the PR's "Files Changed" list
- Navigate to the line you want to comment on
- Press
Shift+F10(Mac:Ctrl+Return) to open context menu - Select "Add Comment"
- Type your comment
- Choose "Add Single Comment" (posts immediately) or "Start Review" (saves as a draft)
- Be specific: "This heading should be H3, not H2"
- Provide context: "Screen readers announce this as 'list with 1 item' - should be a paragraph instead"
- Suggest a fix: "Consider rewording to: 'Click the button to save'"
- Add your first inline comment → select "Start Review"
- Continue adding comments to other lines
- All comments are saved as drafts (not visible to others yet)
When you've reviewed all files:
-
Ctrl+Shift+P(Mac:Cmd+Shift+P) - Type "GitHub Pull Requests: Submit Review"
- Select "GitHub Pull Requests: Finish Review"
- Choose review type:
- Comment - general feedback, no approval decision
- Approve - PR looks good, ready to merge
- Request Changes - issues must be fixed before merging
- Optionally add a summary comment
- Press
Enterto submit
Screen reader note: The review type selector is a radio button group. Use Arrow keys to choose, Enter to confirm.
- All your draft comments post to GitHub
- The PR author receives a notification
- Your review status appears on the PR (Approved / Changes Requested / Commented)
- If you requested changes, the PR cannot merge until you approve it
Web alternative (github.com) - reviewing
Review PRs directly on GitHub.com:
- Open the PR and click the Files changed tab
- Read through each file's diff
- Click the blue + button on any line to add an inline comment
- Choose Start a review to batch comments
- Click Review changes (top right) to select Comment / Approve / Request changes
- Click Submit review
See Accessible Code Review for detailed screen reader steps.
GitHub CLI (gh) alternative - reviewing
# View the PR diff in your terminal
gh pr diff 42
# Approve
gh pr review 42 --approve --body "Looks good."
# Request changes
gh pr review 42 --request-changes --body "Heading hierarchy needs fixing."
# Comment-only (no verdict)
gh pr review 42 --comment --body "A few suggestions."Note: For inline comments on specific lines, use the web interface or VS Code.
Who can merge: Repository maintainers, or contributors with write access.
Before merging, verify:
- All required reviews are approved
- All CI checks pass (green checkmarks)
- No merge conflicts exist
- Branch is up to date with base branch (main)
Changing the base branch: If the PR was opened against the wrong base branch, you can change it from the PR detail view in VS Code. Scroll to the base branch field in the PR detail view and activate the dropdown to select a different target branch. This saves opening the PR on GitHub.com.
Converting to/from draft: You can also convert a ready PR back to a draft (or mark a draft as ready for review) directly from the PR detail view. Scroll to the Status section and use the context menu on the PR title or the "..." more actions button.
- Open the PR in VS Code
- Scroll to the bottom of the PR detail view
- Find "Merge Pull Request" button
- Press
Enter - Choose merge type (see below)
- Confirm
-
Ctrl+Shift+P(Mac:Cmd+Shift+P) - Type "GitHub Pull Requests: Merge"
- Select "GitHub Pull Requests: Merge Pull Request"
- Choose the PR from the list
- Select merge type
- Confirm
| Type | What It Does | When to Use |
|---|---|---|
| Merge Commit | Creates a merge commit preserving all branch commits | Default for most projects; preserves full history |
| Squash and Merge | Combines all commits into one before merging | Cleans up messy commit history; common for feature branches |
| Rebase and Merge | Replays commits onto base branch without a merge commit | Creates linear history; requires clean commit messages |
Screen reader note: The merge type selector is a dropdown or radio group. Navigate with Arrow keys, confirm with Enter.
- Check the repository's CONTRIBUTING.md for guidance
- If unsure, use Merge Commit (the default and safest option)
- The PR closes automatically
- The feature branch can be deleted (VS Code prompts: "Delete branch?")
- Recommended: switch back to
mainand pull the merged changes
Ctrl+Shift+P → "Git: Checkout to..." → select "main"
Ctrl+Shift+P → "Git: Pull"
(Mac users: use Cmd+Shift+P instead of Ctrl+Shift+P)
After merging, the feature branch is no longer needed:
-
Ctrl+Shift+P(Mac:Cmd+Shift+P) - Type "git delete branch"
- Select "Git: Delete Branch..."
- Choose the merged branch
This deletes the branch locally. To delete it on GitHub too:
Web alternative (github.com) - merging
Merge a PR directly on GitHub.com:
- Open the PR's Conversation tab
- Scroll to the merge button at the bottom
- Click the dropdown arrow to choose a merge strategy (Squash, Rebase, or Merge commit)
- Click Merge pull request, then Confirm merge
- Click Delete branch to clean up
GitHub CLI (gh) alternative - merging
# Merge with default strategy
gh pr merge 42
# Squash and merge, then delete the branch
gh pr merge 42 --squash --delete-branch
# Enable auto-merge (merges when checks pass)
gh pr merge 42 --auto --squash-
Ctrl+Shift+P(Mac:Cmd+Shift+P) - Type "git push"
- Select "Git: Push (delete remote branch)"
| Action | Windows | Mac |
|---|---|---|
| Open GitHub view | Activity Bar → GitHub icon → Enter
|
Activity Bar → GitHub icon → Enter
|
| Create Pull Request |
Ctrl+Shift+P → "GitHub Pull Requests: Create" |
Cmd+Shift+P → "GitHub Pull Requests: Create" |
| Checkout PR |
Ctrl+Shift+P → "GitHub Pull Requests: Checkout" |
Cmd+Shift+P → "GitHub Pull Requests: Checkout" |
| Submit Review |
Ctrl+Shift+P → "GitHub Pull Requests: Finish Review" |
Cmd+Shift+P → "GitHub Pull Requests: Finish Review" |
| Merge PR |
Ctrl+Shift+P → "GitHub Pull Requests: Merge" |
Cmd+Shift+P → "GitHub Pull Requests: Merge" |
| Add inline comment |
Shift+F10 (in diff view) → "Add Comment" |
Ctrl+Return (in diff view) → "Add Comment" |
| Navigate diff hunks |
F7 (next), Shift+F7 (previous) |
F7 (next), Shift+F7 (previous) |
| Accessible Diff Viewer |
Alt+F2 (in diff view) |
Option+F2 (in diff view) |
Issue: The GitHub Pull Requests panel is empty.
- Verify you're signed in:
Ctrl+Shift+P(Mac:Cmd+Shift+P) → "GitHub Pull Requests: Sign in" - Check you have a folder open containing a Git repository
- Refresh the panel:
Ctrl+Shift+P(Mac:Cmd+Shift+P) → "GitHub Pull Requests: Refresh Pull Requests List"
Issue: PR creation fails.
- Verify you've pushed your branch:
Ctrl+Shift+P(Mac:Cmd+Shift+P) → "Git: Push" - Check you have write access to the repository
- Ensure your branch is ahead of the base branch (has new commits)
Issue: VS Code can't connect to GitHub.
- Sign out and sign back in:
Ctrl+Shift+P(Mac:Cmd+Shift+P) → "GitHub Pull Requests: Sign out" → then sign in again - Check your GitHub Personal Access Token (see Appendix D: Git Authentication)
- Verify network connection
Time: 3 minutes | What you need: VS Code with GitHub Pull Requests extension installed and signed in
-
Open the PR view - Press
Ctrl+Shift+P→ typePull Requests: Focus on GitHub Pull Requests View→Enter. - Find a PR - Navigate the tree with arrow keys. Expand a PR to see its changed files.
-
Open a diff - Press
Enteron a changed file. The diff editor opens. -
Use the Accessible Diff Viewer - Press
F7to jump to the first change. Your screen reader announces what was added or removed. PressF7again to move to the next change. -
Leave a comment - Position your cursor on a line you want to comment on, then press
Ctrl+Shift+P→Pull Request: Add Comment on Current Diff Line. Type a brief, constructive comment and submit.
You're done. You just reviewed a pull request entirely from VS Code.
What success feels like: You read a diff, heard the changes announced by your screen reader, and left feedback - all without opening a browser. This is how many developers review code every day.
Next: GitHub Copilot
Back: Git & Source Control in VS Code
Related: Working with Pull Requests | Issue Templates
Getting Started
Core Chapters
- 1. GitHub Web Structure
- 2. Navigating Repositories
- 3. The Learning Room
- 4. Working with Issues
- 5. Working with Pull Requests
- 6. Merge Conflicts
- 7. Culture and Etiquette
- 8. Labels, Milestones, Projects
- 9. Notifications
VS Code and Git
AI and Accessibility
Appendices
- A. Glossary
- B. Screen Reader Cheat Sheet
- C. Accessibility Standards
- D. Git Authentication
- E. Markdown
- F. Gists
- G. Discussions
- H. Releases, Tags, Insights
- I. GitHub Projects
- J. Advanced Search
- K. Branch Protection
- L. Security Features
- M. VS Code Accessibility
- N. Codespaces
- O. GitHub Mobile
- P. GitHub Pages
- Q. Actions and Workflows
- R. Profile, Sponsors, Wikis
- S. Orgs and Templates
- T. Open Source
- U. Resources
- V. Accessibility Agents Ref
- W. Copilot Reference
- X. Copilot AI Models
- Y. Workshop Materials
- Z. GitHub Skills Catalog