DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-branch-worktree

w

dsh-branch-worktree

Manifest valid

同一个仓库的不同分支各用一个独立目录干活:互不干扰,各自提交,各自开 PR。

hasBundlePatch

dsh-branch-worktree

让同一个仓库的不同分支同时开工:每个分支一个独立目录,互不干扰,各自提交,各自开 PR。

DSH License


问题

一个 agent 一个目录。想同时干两件事,就得排队:

  • 让甲改登录、乙修错别字 —— 只能等前者提交完、切回主干、乙再开始
  • 硬要并行?两个会话在同一份工作区里改同一批文件,谁也说不清谁的改动
  • git checkout 切分支会把另一个会话正在读的文件换掉,工具直接跑错

做法

一个分支一个 git worktree,一个 worktree 一个目录,一个目录一个 DSH 项目(侧边栏直接多一行):

                    ~/app(主干,main)
                    ├── ~/.dsh/worktrees/app-1a2b3c4d/feat-login    ← 会话甲
                    └── ~/.dsh/worktrees/app-1a2b3c4d/fix-typo      ← 会话乙

它们是同一个仓库:共享对象库和提交历史,git log 互相可见,但工作区、索引、HEAD 各管各的。所以:

  • 甲的未提交改动,乙完全看不到;乙 git status 永远是干净的
  • 甲 git commit 只动 feat/login,乙 git commit 只动 fix/typo
  • 两边各自 git push、各自 gh pr create,互不抢占
  • 分支目录放在仓库外面,git status 里不会多出一个奇怪的未跟踪目录

装

dsh plugin --profile desktop add github:walldong/dsh-branch-worktree

重启 Harness 后,agent 多出 repo_branch 工具。

用

agent 自己会用,你也可以直接说:"开个 feat/login 分支做登录,另外开 fix/typo 修文案。"

action干什么
open从主干开分支 + 独立目录,并注册成 Harness 项目。返回新目录路径
status当前目录:分支、改动文件数、领先上游几个提交、PR 状态
commitgit add -A + 提交,返回短 SHA
push推到 origin 并设置 upstream
pr已有 PR 就返回它,否则推送后 gh pr create
list仓库里所有分支目录,各自的改动数和领先提交数
close删掉目录,分支和提交都保留(deleteBranch 才删分支)

为什么提交要走工具

分支目录里的 .git 是一个指向主仓库 .git/worktrees/<name> 的文件。沙箱的 workspace 边界按会话目录划,那个文件在外面 —— agent 自己 git commit 会撞上写入拒绝。所以提交、推送、开 PR 都由 Host 执行:工具在宿主进程里跑,不受会话沙箱限制。

分支会话的系统提示里会写明这一点,不用你教。

一点设计

  • 一个分支一个目录,由仓库路径 + 分支名哈希决定,重复 open 同一个分支会退回同一个目录(git 本身也拒绝同一分支检出两次)
  • 删目录不删分支:close 只 worktree remove,没合并的提交一个都丢不了
  • 有 PR 就不再开:pr 先查,避免一个分支堆出三个 PR
  • 主干自己判断:先看 origin/HEAD,退一步找 main / master
  • gh 没装或没登录时,pr 直接报错说清楚,不假装成功

结构

文件作用
index.jsHost 插件:repo_branch 工具 + 分支会话的提示段
cordis.patch.ymlbundle patch
test.js自检:临时仓库 + 裸 origin,验证隔离、提交、推送、关闭、重开、报错

自检

node test.js

自检用一个临时仓库 + 裸 origin,验证:两分支目录互不可见、各自提交、推送设置 upstream、关目录不丢分支、同一分支重开复用同一目录、主干不能被移除、没 remote 的 push 和没有 GitHub remote 的 PR 都会明确报错。

真实 GitHub 路径也跑过一遍:新建私有仓库 → 开两个分支 → 各自提交 → 各自开 PR(#2、#3)→ 关目录,分支都还在。

License

MIT

Comments

Loading…

Similar plugins

dsh-worktree-manager

by shenkonghui

Git worktree management for dsh — group workspaces by repository, create and switch worktrees, and browse their changes, commit history and file diffs.

Development & InfrastructureManifest valid

★ 0

JavaScript

Sep 18, 2026

dsh plugin --profile web add dsh-worktree-manager

A Git worktree plugin for DeepSeek Harness that creates task branches, registers worktrees as DSH Workspaces, and opens isolated sessions.

Development & InfrastructureTerminal & ClientsManifest valid

★ 0

dsh plugin --profile web add @xzhi/dsh-simple-worktree-plus

by JohnXu22786

DSH 插件:为任务自动创建隔离的 git 工作区,管理创建/同步/收尾全生命周期 (task-isolated git worktrees for DeepSeek Harness)

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 2

MIT

JavaScript

Oct 24, 2026

dsh plugin --profile web add worktree-mgr

by zhang-guo-wen

Git worktree isolation for DeepSeek Harness: create a worktree, register it as its own project, and start the session inside it

Manifest valid

★ 0

Apache-2.0

TypeScript

Oct 22, 2026

dsh plugin --profile web add @guowenzhang/dsh-worktree

by elfgzp

DeepSeek Harness plugin: pick a Git branch (or create one) on the New Session screen and start the conversation inside an automatic worktree.

Development & InfrastructureManifest valid

★ 1

MIT

JavaScript

Nov 5, 2026

dsh plugin --profile web add dsh-branch-worktree

by zxbingoo

DSH worktree isolation, setup progress, archive cleanup, and session file/Git review panel

Manifest valid

★ 0

MIT

JavaScript

Nov 9, 2026

dsh plugin --profile web add dsh-minimalist-worktree