github / github/copilot-cli

Worktrees are nightmare, should be disabled by default

未关闭
#2,243 3 条评论 16 个 reaction 已指派 0 人 在 GitHub 查看
area:configuration area:tools
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

Worktrees must be disabled by default, and enabled only by human user! Right now I found myself in a situation when a session was handed to CLI, and ended up with thousands of new lines of _useful_ code, but impossible to apply back to main worktree for whatever git-related reason.

Applying complex subtree patches with AI-generated code causes immeasurable suffering, as there is no reliable merge UI inside VSCode, and whenever worktree fails to merge, user is stuck with hairy git command line options or lottery-like AI-driven resolution, which can render whole branch broken (if you were careful enough to branch out before starting a session):

Image

What am I as user supposed to do here??

Git output from VSCode:
```
.git/copilot/worktree-2026-03-24T01-13-39.patch:4471: trailing whitespace.
**Amended:** 2026-03-23 — hostnames confirmed
error: .github/prompts/continue-autonomous-implementation.prompt.md: already exists in working directory
error: patch failed: ./.adonisjs/server/controllers.ts:8
error: ./.adonisjs/server/controllers.ts: patch does not apply
error: patch failed: ./.adonisjs/server/pages.d.ts:18
error: ./.adonisjs/server/pages.d.ts: patch does not apply
error: patch failed: ./app/middleware/auth_middleware.ts:30
error: ./app/middleware/auth_middleware.ts: patch does not apply
error: ./inertia/composables/use_supabase_auth_legacy.ts: already exists in working directory
error: patch failed: ./inertia/locales/en.ts:1193
error: ./inertia/locales/en.ts: patch does not apply
error: patch failed: ./inertia/locales/ja.ts:1174
error: ./inertia/locales/ja.ts: patch does not apply
error: patch failed: ./inertia/locales/ru.ts:1210
error: ./inertia/locales/ru.ts: patch does not apply
error: patch failed: ./inertia/locales/th.ts:1168
error: ./inertia/locales/th.ts: patch does not apply
error: patch failed: ./inertia/locales/zh.ts:1117
[... goes on for every file modified in the worktree...]
```

To be clear, the main worktree is clean, nothing to commit, yet all these conflicts from the worktree that was spawned just couple hours ago... Speaking as a git user with years of experience, this is really baffling and totally uninvited behaviour.

### Affected version

v1.0.11

### Steps to reproduce the behavior

Start a session in Copilot chat, handover to CLI, get tied in a 'apply worktree changes' knot.

### Expected behavior

No worktrees unless user enables them

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。