You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clicking "checkout" on a PR from a branch already in a worktree fails #9161
Repository Clone Configuration (single repository/fork of an upstream repository): single repository
GitHub Product (GitHub.com/GitHub Enterprise version x.x.x): Github.com
Steps to Reproduce:
Agentic workflows often checkout a branch locally in a worktree and push.
Create a PR with the new branch
From your main project clone, try to "checkout" the PR to review
The dialog shows:
Error switching to pull request: Failed to execute git
In the output, we see:
2026-11-04 09:03:03.760 [info] fatal: '<branch>' is already used by worktree at '<path>'
Problem 1: this shows as an [info] message, so it's easy to miss
Problem 2: with agentic workflows where reviewing multiple PRs is more common, there's friction in trying to find the appropriate local worktree and open VSCode in a new window.
A simple fix would be to provide an option to always open a new local branch just for the PR review with the remote as the upstream, e.g. gh/pr-local/NNN -> feat-1234. Then there's much less likelihood of a collision with agent worktrees.
Activity