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

Offen
#9,161 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
git, github, typescript, vscode

Rechercherichtung

Start by tracing the pull request checkout command in the VS Code extension and how it handles branches already checked out in a worktree. The issue suggests offering a separate local review branch with the PR’s remote as upstream; inspect existing checkout options and tests to see how that flow fits. Done means reviewing a PR whose branch is already in another worktree can proceed through the proposed option.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

  • 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.

Vorherrschende Sprache
TypeScript
Sterne
2.6k
Forks
811
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
70

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/vscode-pull-request-github

Alle Issues in microsoft/vscode-pull-request-github

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.