Paths Subjects Questions Quizzes Pricing Search
Advanced Open Pro

Reviewing a Teammate's PR in an Isolated Worktree

A teammate opened PR #482. You want to pull it down, run it locally, and poke at it without disturbing the in-progress branch you're already working on in your main checkout.

  1. What single command creates a worktree checked out to that PR's exact head commit, and where does Claude Code place the resulting directory?
  2. While working in that worktree, a command's working directory accidentally resolves back to your main checkout. What happens, and why is this a stronger guarantee than "an ordinary git worktree is just a separate directory"?
  3. You close the terminal without a clean interactive exit, and later find the worktree still exists with a lock on it. What happened, and how do you clean it up?

Share this question

← Back to Git Workflows with Claude Code practice

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.