LaoYueHanNi/dsh-git-worktree 预览 preview

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/,删除插件不会自动删除已创建的工作树文件夹。升级旧版本时需要先卸载旧包再重新安装,插件设置和工作树数据会完整保留。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • 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

Awesome DSH Plugin

dsh-git-worktree in the Web UI

简体中文 | 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-worktree

Upgrading from a legacy github: install (≤ 0.3.2, package name dsh-git-worktree)? An in-place update fails 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-x in 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's git status stays 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/gitworktree layouts (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/gitworktree by default) read-only — existing worktrees stay put and keep working; new ones are created inside their repository. A legacy ~/.dsh/gitworktree/settings.json value 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 →

← 上一个 Prev dsh-bottom-bar 下一个 Next awesome-dsh-plugins →