Skip to main content
Reviewing pull requests traditionally means stashing your work, checking out the PR branch, testing it, then returning to your work. Worktrees eliminate this friction by letting you review PRs in isolated directories.

The Traditional Pain

Reviewing a PR without worktrees:
  1. Stash your current work: git stash
  2. Fetch PR branch: git fetch origin pull/123/head:pr-123
  3. Checkout PR: git checkout pr-123
  4. Install dependencies: npm install
  5. Test the changes
  6. Return to your work: git checkout your-branch
  7. Unstash: git stash pop
  8. Reinstall dependencies: npm install
This is slow, error-prone, and disrupts your flow.

Worktree Review Flow

1

Create review worktree

While working on your feature, create a worktree for the PR:
The -x flag prevents opening an editor, keeping your current editor focused on your work.
2

Fetch and checkout the PR

Or manually:
3

Review in isolation

Test the PR without affecting your work:
Your original work in repo-feature-login/ is completely untouched.
4

Leave feedback

Add review comments using GitHub CLI:
Or request changes:
5

Clean up

After reviewing, remove the worktree:
Your original work remains untouched. Return to it instantly:

Multiple PR Reviews

Review multiple PRs simultaneously:
All reviews happen independently without conflicts.

Review Scenarios

Quick Approval

For simple PRs that just need a quick look:

Deep Review

For complex PRs requiring thorough testing:

Review + Test Changes

Test PR with your feature:

Suggest Changes

Make suggested edits directly:

GitHub CLI Integration

Powerful PR review commands with gh:

List PRs needing review

Check out PR directly

View PR details

Review with comments

Add inline comments

Advanced Review Workflows

Review changes side-by-side:
Or use a GUI:
Benchmark PR against main:
Check for security issues:
Compare UI changes:

Team Review Practices

Assign yourself as reviewer

Create worktree immediately when assigned:

Batch review sessions

Set up all PRs for your review session:

Leave detailed feedback

Quick Commands Reference

Best Practices

Review in fresh worktrees - Always create a new worktree for PR reviews to ensure a clean environment.
Use descriptive names - Name review worktrees pr-123 or review-feature-name for clarity.
Clean up after reviewing - Remove review worktrees promptly to avoid clutter: gwt clean

Troubleshooting

If gh pr checkout fails:
If dependencies conflict with your main work:
Each worktree has independent node_modules.
Run PR dev server on different port:

Next Steps

Parallel Agents

Run multiple AI agents simultaneously on different branches.

Feature Development

Learn the complete feature development workflow.