github / github/app

Improve automatic cleanup of session worktrees and branches

未关闭
#2,787 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
没有语言数据
星标
2.1k
派生
153
PR 合并指标
30 天内没有已合并 PR

描述

I use the GitHub Copilot app across many repositories and parallel sessions. Session isolation through worktrees and branches is valuable, but completed work accumulates quickly.

After several weeks, I had 96 stale local branches and 12 worktrees across 41 repositories. Most branches belonged to merged PRs—especially squash merges—but Git could not reliably identify them as merged. Remote branch deletion also left local branches behind. Only one worktree was truly orphaned, but distinguishing it required substantial manual investigation.

Suggested improvements:

- Optional automatic session archival and worktree cleanup after PR merge

- PR-aware detection of squash-merged branches

- Stale-session reminders based on last activity

- A cleanup dashboard showing session, worktree, local branch, remote branch, PR status, and uncommitted changes together

- A safe “archive session and clean associated Git state” action

- Recovery information before destructive cleanup

Cleanup should remain conservative and never remove unique commits or uncommitted files automatically. The main need is better lifecycle visibility and an explicit, integrated cleanup workflow. Parallel agent sessions make this accumulation inevitable rather than exceptional.

```
{
"type": "eval",
"skill": "github-copilot-app",
"mode": "feature_request",
"severity": "suggestion",
"category": "ux",
"user_input": "Improve automatic lifecycle cleanup for session worktrees and branches.",
"timestamp": "2026-08-11T18:57:18Z",
"session_id": "9a2c908c-134c-4552-b8c3-9e4cfe79b838",
"filed_issue": null
}
```

---
| Field | Value |
| --- | --- |
| App version | 1.1.6 |
| OS | macOS 26.6.0 |
| Theme | GitHub |
| Path | /chat |
| Tenure | Week 16 |

贡献指南

打开贡献指南

调研方向

Issue 中没有确定文件、测试或入口点。首先明确纳入范围的是哪项 lifecycle-cleanup 能力,然后定义在实现之前必须显示或更改的 session、worktree、branch、PR 和 recovery 状态。

由索引模型根据 Issue 内容生成。

评估

技术栈
git, github
领域
desktop, developer-experience, tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

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