Skip to content

Clicking "checkout" on a PR from a branch already in a worktree fails #9161

Open

Description

  • Extension version: 0.174.0
  • VSCode Version: 1.144.0
  • OS: macOS Sequoia 15.8.1
  • 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:

  1. Agentic workflows often checkout a branch locally in a worktree and push.
  2. Create a PR with the new branch
  3. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions