gh pr checkout 123 --branch review-fix

Category: GitHub CLI

gh pr checkout 123 --branch review-fix

Check out a PR into a custom local branch

Fetches the PR's head branch and checks it out locally. --branch names the local branch, overriding the default of using the PR's head branch name, which avoids collisions when reviewing several PRs. Add --force to overwrite an existing local branch.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.