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

未關閉
#9,161 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
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 小時
30 天內合併 PR
70

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microsoft/vscode-pull-request-github 的其他 Issue

查看 microsoft/vscode-pull-request-github 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。