You want to test a colleague's PR on your machine.
BeginnerScenarioRemotes, Collaboration and Pull Requests
Answer
Situation read → You need the PR's branch locally, even if it comes from a fork.
What I'd do →
gh pr checkout 482.- Without gh:
git fetch origin pull/482/head:pr-482 && git switch pr-482. - Run tests and review with real tooling.
- Delete the branch afterwards:
git branch -D pr-482.
Why → GitHub exposes every PR at refs/pull/<n>/head, regardless of origin.
Interview tip → refs/pull/<n>/merge shows the tentative merge result with the base branch.
More on Remotes, Collaboration and Pull Requests
You are new to a team. How do you collaborate daily without stepping on others' toes?BeginnerYou are migrating a repo from Bitbucket to GitHub and must keep every branch and tag.IntermediateYou want to contribute a fix to an open-source project you do not have write access to.BeginnerA teammate sent a 3,000-line PR and nobody can review it properly.IntermediateA reviewer asks for changes. How do you update the PR cleanly?BeginnerYour team wants stacked PRs so that large work arrives in small reviewable steps. How do you set it up?Advanced