LaoYueHanNi/dsh-git-worktree
在 Web 界面进行分支切换与 git worktree 隔离的 DSH 插件
Project Overview项目介绍
This is a native DSH plugin built exclusively for the DSH web UI, designed to add simplified Git branch and worktree management tools directly into DSH’s interface. It is installed via the built-in DSH plugin manager, with the official install command dsh plugin --profile web add @laoyuehanni/dsh-git-worktree. It requires DSH version 0.1.2-rc.1 or later; users running older DSH alpha builds can install a dedicated compatibility build tagged @dsh-alpha for full functionality.
The plugin adds an IDEA-style collapsible branch picker that organizes branches by path hierarchy, with separate groups for local and remote branches and built-in search for quick filtering. It supports direct checkout of remote branches, right-click context menus for common actions like check out, rename, delete, and copy branches, and quick hopping between existing worktree sessions. Users can create new isolated worktrees for any branch, update current branches to their upstream, and fetch all remotes to prune stale tracking branches without leaving the DSH UI.
The plugin is released under the open-source MIT license, with no associated costs or closed-source components. When you remove the plugin via the DSH plugin manager, any existing worktree folders you created are kept intact, only the plugin code and its settings are removed. If you are upgrading from an older legacy version installed directly from GitHub, you need to remove the old package first before installing the new npm version to avoid loading errors, with all worktree data and settings preserved.
这是一个专为 DSH Web UI 开发的原生插件,提供 Git 分支与工作树的可视化管理功能。用户可以通过插件界面查看当前分支,直接切换分支或者开启隔离工作树,获得独立的开发工作区。插件通过 DSH 官方插件管理器安装,兼容 DSH 0.1.2-rc.1 及以上版本,旧版本 DSH 也提供专用的兼容构建包。
这款插件适合日常需要在多个 Git 分支间切换、同时维护多个功能开发的开发者。用户可以通过 IDEA 风格的层级分支选择器快速定位分支,支持直接检出远程分支,右键菜单可快速完成新建、重命名、复制、删除分支等操作,还能快速跳转至已有工作树开启新会话。
插件采用 MIT 许可开源,完全免费使用,安装后无需额外配置即可运行。工作树存储根目录可在插件设置中自定义,默认存储在 ~/.dsh/gitworktree/,删除插件不会自动删除已创建的工作树文件夹。升级旧版本时需要先卸载旧包再重新安装,插件设置和工作树数据会完整保留。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-git-worktree(LaoYueHanNi/dsh-git-worktree)
仓库:https://github.com/LaoYueHanNi/dsh-git-worktree
本站详情页:https://www.yhbd.top/plugins/laoyuehanni-dsh-git-worktree/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 8 · 最近提交 2026-09-29 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 8 stars - very few users, little community feedback星标只有 8,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add @laoyuehanni/dsh-git-worktree
把 LaoYueHanNi/dsh-git-worktree 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-git-worktree

简体中文 | English
A dsh plugin for simple branch & worktree management in the Web UI. The composer tool row shows the current branch: pick another to switch in place, or flip the Worktree toggle to get an isolated worktree as a real workspace — as shown in the screenshot above.
Repo: https://github.com/LaoYueHanNi/dsh-git-worktree
[!IMPORTANT] GitHub direct installs have ended — the repository no longer carries prebuilt output. Install from npm instead:
dsh plugin --profile web add @laoyuehanni/dsh-git-worktreeUpgrading from a legacy
github:install (≤ 0.3.2, package namedsh-git-worktree)? An in-placeupdatefails to load — remove the old name first, then add again. Worktree folders and the plugin's settings carry over untouched.
Features
- IDEA-style branch picker: the branch menu treats
/as a folder hierarchy — collapsible folders, last-segment labels, the checked-out branch's chain opens centered. Local and remote branches render as two collapsible groups (a single remote strips its prefix), with bottom search (ancestor folders kept, hits highlighted), locate-current-branch and expand/collapse tools, and ↑N/↓N divergence marks on tracking branches. - Remote branch checkout: pick
origin/feat-xin the remote group and it checks out in place with a tracking branch directly (no confirmation); the worktree toggle sends the pick to an isolated worktree instead. - Row context menu: right-click a branch row for six verbs — check out (immediate, no confirmation), new branch, new branch and check out, rename branch (local rows), delete branch (local rows, the safe
-d: git refuses unmerged commits and occupied branches), copy branch; a worktree row offers go-to-worktree, copy path, and remove worktree. Second-level dialogs open IN PLACE of the menu; in-place actions keep the menu open, so rows can be acted on in a run. Keyboard: arrow keys + Enter. - Worktree quick hop: the main checkout's blank-session menu groups branches held by live worktrees under Worktrees (hover shows the directory) — the row menu's "Go to this worktree" hops straight into that directory and starts a fresh session.
- Branch switching: pick a branch — an in-place switch, no confirmation. Inside a linked worktree the entry scopes down: other branches stay listed but dimmed, with a hint to act from the main checkout; a started session's menu shows only its own branch (fetch and update still work).
- Create from any branch, rename in place: right-clicking any branch row creates FROM that branch (checkouts untouched) or creates-and-checks-out (checked out on the spot); the create flyout validates as you type (git ref rules plus a duplicate check) and fires in one stroke, a failure keeping it open for a renamed retry. Local rows rename in place too.
- Remote sync: the last toolbar tool fetches every remote and prunes stale tracking branches — the list refreshes in place, no terminal round-trip.
- Branch update: update the CURRENT branch to its upstream (fast-forward only); divergence, a missing upstream, or conflicting uncommitted changes are refused with git's own explanation — the plugin never stashes or rewrites history on your behalf.
- Worktree isolation: in a session that has not started, right-clicking any branch row offers Create worktree (reuse or fresh directory) or New branch and worktree (cut a new branch off that row, name typed by hand); confirming isolates into
<repo>/.dsh/gitworktree/<branch>/inside the repository (locally ignored through.git/info/exclude— the repo'sgit statusstays clean) and registers a real workspace, with same-branch re-creates reusing the existing worktree wherever it lives. Once the session starts the directory is fixed — the worktree verbs hide along with the Worktrees group. - Worktree removal: the Worktrees group's row menu (and the manager dialog) offers Remove worktree — the confirm first counts uncommitted files (red) and ahead commits, and warns the workspace's sessions will be archived; confirming removes the git worktree (the branch itself survives), then archives the sessions and drops the workspace registration. A git failure leaves the DSH side untouched and retries in place. A directory with a running session withholds the verb.
- Worktree manager: the plugin's configuration page on Settings → Plugins opens a dialog listing every worktree across both storage locations — the per-repository
.dsh/gitworktreelayouts (new) and the legacy central root (old, kept for existing worktrees) — grouped by repository with a source badge, orphan directories included. - Legacy storage, read-only: the same page shows the historical central storage root (
~/.dsh/gitworktreeby default) read-only — existing worktrees stay put and keep working; new ones are created inside their repository. A legacy~/.dsh/gitworktree/settings.jsonvalue migrates automatically on upgrade.
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
tieveto666-code/dsh-client-ui-trace-graph
omdsh-dev/DSH-better-sidebar
LiPu-jpg/Openwrite
cocode-agency/cocode
drewnekota/cetus
cosyncing/cosyncing
UNLINEARITY/dsh-code
Cerbur/clutch-dsh