Review pull requests without disrupting your current work
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.
gwt review-auth-refactorcd repo-review-auth-refactorgh pr checkout 789npm installnpm testnpm run dev # Manual testing# Run through test casesgh pr review 789 --comment
Review + Test Changes
Test PR with your feature:
# Create worktree for testinggwt test-integration -xcd repo-test-integration# Merge PR branch locallygit merge origin/pr-branch# Test integrationnpm test
# In PR worktreecd repo-pr-123npm run benchmark > pr-results.txt# In main worktreecd reponpm run benchmark > main-results.txt# Comparediff main-results.txt ../repo-pr-123/pr-results.txt
Security review
Check for security issues:
cd repo-pr-123npm auditnpm run lint:securitygit diff main... | grep -i "password\|token\|secret"
Visual regression testing
Compare UI changes:
# Main versioncd reponpm run dev -- --port 3000npm run screenshot# PR versioncd repo-pr-123npm run dev -- --port 3001npm run screenshot# Compare screenshotsnpm run compare-screenshots
# Get list of PRs assigned to yough pr list --search "review-requested:@me" --json number --jq '.[].number'# Create worktrees for all of themgwt pr-101 pr-102 pr-103 pr-104 -x# Review eachfor pr in 101 102 103 104; do cd repo-pr-$pr gh pr checkout $pr npm install && npm test cd ..done
cd repo-pr-123gh pr review 123 --comment --body "$(cat <<'EOF'## Review Comments### What I liked- Clean implementation of auth logic- Good test coverage### Suggestions - Consider extracting validation into a separate function- Add JSDoc comments to public methods### Questions- Have you tested this with expired tokens?EOF)"