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

オープン
#9,161 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
git, github, typescript, vscode

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
2.6k
フォーク
811
平均マージ
1日 8時間
マージ済み PR(30日)
70

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/vscode-pull-request-github のほかの issue

microsoft/vscode-pull-request-github の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。