DeepSeek Harness Plugin

happyqu/dsh-plugin-git

Stars ★ 4 Downloads (30d) 2,026 Category Git & Code Review Added 2026-10-20 npm @happyqu/dsh-plugin-git

Git workbench in the DSH session header and overlay: view changes, commit, fetch, pull, push, and browse branches and history in existing local repositories.

Install

# from npm (prebuilt)

dsh plugin --profile web add @happyqu/dsh-plugin-git

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:happyqu/dsh-plugin-git

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

中文 | English

Manage Git projects from inside a DeepSeek Harness (DSH) session: review changes, commit code, sync branches, browse history, tidy up commits, and resolve conflicts — all in a dedicated workbench window, without leaving the conversation to open a separate Git client.

Ships with Chinese and English interfaces, and follows DSH's dark/light theme and font-size settings.

DSH Git workbench

Highlights

  • Safety that lets you act with confidence: a restore point is recorded automatically before history is rewritten, with one-click undo; if something goes wrong, you can recover commits from the local operation log (reflog) by creating a recovery branch. Destructive operations such as delete, move, prune, and force-push always preview first and confirm second.
  • A full workbench, not a stripped-down panel: lane-based commit graph, hunk-level staging, interactive rebase and history rewriting, bulk cherry-pick, a three-way conflict editor, inline blame, worktree management, and Git LFS import/export — operations that usually require the command line, all with a graphical interface.
  • Deep integration with DSH: Git always follows the current workspace and session; after creating a project or cloning a repo you land straight in the matching session; a worktree can be "opened as a DSH workspace"; AI features reuse the model selected for the session by default. It is a pure UI plugin — it registers no tools or prompts with the conversational agent, so it never interferes with your session.
  • Zero friction for everyday work: the session title bar shows a persistent branch, change-count, and sync-status chip, so you can switch branches, view changes, and Fetch/Pull/Push without opening the workbench; you can switch branches even before sending the first message in a new session.
  • Works out of the box: install and use — no build step; no mandatory dependencies besides your system Git, and no network access outside AI features.

Installation

  1. Install Git 2.36 or later and make sure git is available on your PATH; if it is not detected, you can specify the executable path in the plugin settings.
  2. In DSH, open Plugins → Add plugin, enter @happyqu/dsh-plugin-git, then install and enable it.
  3. Open a project workspace and enter the Git workbench.

There are two entry points:

  • After choosing a workspace in a new session, before sending any message, use the branch button to the right of the mode selector (e.g. "Standard mode") to switch or create a branch; the Git workbench can be opened from the bottom of the branch popup.
  • Once a conversation has started, the entry is the Git button in the session title bar; the adjacent chip persistently shows the current branch, number of changes, and sync status — click the chip to switch branches, view changes, or sync in place.

Git always follows the current workspace; Git is unavailable while switching workspaces. The plugin frontend and Host share the same version protocol and must be reloaded together after an update; older Git and older Hosts do not provide a fallback execution path.

Layout

The workbench is a draggable, resizable standalone window: an activity bar on the left switches modules, a list in the middle, a diff and preview area on the right, and a status bar at the bottom persistently showing the branch, ahead/behind counts, commit count, last Fetch time, current user, and Git version.

The activity bar has seven modules — Changes, Commit graph, History, Stash, Worktrees, Output, Settings; the compare view is reached from commit details. Interface language and theme follow DSH.

Changes and commits

  • The change list separates unstaged and staged files, with whole-file or hunk-level staging and discarding; file status is color-coded by M/U/D, deleted files are struck through, and the list supports search plus tree/flat layouts.
  • Commit-scope preview: confirm which files and hunks will be included before committing; unselected hunks are excluded automatically, so nothing is committed by mistake.
  • The commit box supports Ctrl+Enter; a split button offers follow-up steps such as "Commit and push" and "Publish branch".
  • Multiple change lists: split changes for different tasks into separate lists, drag to reorder, move files across lists, stage and commit each list independently — you can even stash only one list's changes without affecting the others.
  • Unregistered Git repositories: the change list detects standalone Git repositories inside untracked directories and flags them, letting you open that repository directly, choose "Ignore locally" (written to the outer repository's .git/info/exclude), or "Add to .gitignore" (shareable with commits). Discarding changes preserves these repositories and the files inside them.

Branches and sync

  • Create, rename, delete, switch, and set upstream for branches, tags, and remotes; the branch selector lists local branches flat with search, and groups tags into collapsible sections.
  • Guided sync: the "Next step" button in the title bar suggests the action based on the current state — pull when behind, push when ahead, publish the branch when the remote lacks it, go resolve conflicts when there are any, and let you choose merge or rebase when diverged from the remote.
  • Fetch (including pruning stale remote-tracking refs), pull-and-merge or pull-and-rebase, push, and force-push with lease; the affected commits are shown before each operation.
  • Force-push is reachable from three places — the title bar, the branch menu, and the session-header sync menu — and always confirms before executing. It only offers --force-with-lease: if the remote has commits you haven't fetched, the push is rejected rather than overwriting them. When rejected, the message explains that lease protection kicked in and offers a one-click "Fetch first". The plugin never provides a bare --force.
  • Background auto-fetch can be enabled and its interval configured in Settings → Sync.
  • Enter via Add workspace in the sidebar or a new session's menu to create a new project, use a local directory, or clone a repository; new projects remember the last save location and land straight in the matching session when done.

History and compare

  • Commit history is organized by branch; expand any commit to see the files it changed and jump directly to that file's version diff.
  • Commit graph shows branch and merge topology in lanes, distinguishing local branches, remote branches, and tags by color, with range and sort controls.
  • Compare view: per-file diffs and commit lists between any two refs (branches, tags, commits).
  • Preview: full file and image preview, with image zoom and a lightbox comparison; code with syntax highlighting, line numbers, and a diff overview ruler, plus line wrapping for long lines.
  • Inline blame: a per-line annotation column shows each line's commit and author, uncommitted lines are marked separately, and clicking any line shows that line's history.
  • Export: history files and a full repository snapshot can be exported as ZIP.

Tidy up history

  • Interactive rebase: reorder unpushed commits, edit commit messages, squash, fixup, edit (stop to amend), or drop; the UI provides an operation preview and step-by-step progress.
  • Rebase onto branch: from the branch menu, rebase the current branch onto another branch.
  • Cherry-pick: pick multiple commits onto the current branch at once, optionally appending "(cherry picked from …)" to the message for traceability.
  • Undo and recover: revert creates an inverse commit; a restore point is recorded automatically before each rewrite and can be returned to with one click; any reflog entry can be used to create a recovery branch.

Conflicts and stash

  • Conflict files get a three-way comparison of "common base / current version / incoming version"; choose hunk by hunk, accept both sides, or manually edit the merged result and mark it resolved after saving. Binary conflicts choose a full version. During rebase the UI explains which way ours/theirs maps.
  • External merge tools such as VS Code can also be invoked.
  • While a merge / rebase / cherry-pick is in progress, view the operation progress and the staged files it will use, and continue, skip, or abort.
  • Stash: create, apply, pop, and delete, with a full diff preview; you can stash an entire change list.

Worktrees

Especially useful when running several directories of the same repository in parallel for different tasks:

  • View and open: list each worktree's branch, changes, and in-progress operations. "Open in Git" only switches the Git operation directory; "Open as DSH workspace" enters the matching workspace session, reusing an existing workspace when possible. The branch menu can also create a worktree or open the worktree that occupies a branch.
  • Safe removal: removal deletes the directory and its associated record but keeps the branch; force removal is not offered. The main worktree, the current worktree, locked directories, and directories containing changes, untracked or ignored files, or unfinished Git operations cannot be removed. Blocking reasons are previewed before execution.
  • Lock / move / repair link: temporarily offline disks can be locked first to keep their records from being pruned; lock/unlock does not require the directory to be online. Move preserves local files and the branch, and the target directory must not exist. After manually moving a directory, select the old record and "Repair link". Move and repair do not rewrite existing DSH workspace paths, so reopen the workspace from the new directory.
  • Prune stale records: preview all prunable records first, then prune only the associated metadata while keeping branches and working directories; lock any offline worktrees you want to keep beforehand.
  • Task notes and drafts: the list shows recently used directories first by default and supports sorting by branch and searching task notes. Notes are stored only on the current device and never written to the repository; before switching worktrees you can save or discard drafts, and unsaved drafts are retained while the plugin runs.
  • Compare worktree contents: compare the files currently on disk in two directories (including staged, unstaged, and untracked), with both diff and side-by-side preview. It uses read-only snapshots that do not change files, the index, or repository objects; snapshots are valid for 5 minutes, capped at 5000 files, 32 MiB total, and 4 MiB per file.

Git LFS

Managed in Settings → Git LFS: view installation and repository status, maintain .gitattributes tracking rules, view and sync LFS content, and perform history import (install) and export (migrate) with backup and rollback.

AI assistance

  • Generate commit message: generated from the currently staged diff, filled into the commit box with one click, then editable.
  • Commit explanation: renders an AI explanation of the change inline in commit details.
  • Choose the model, reasoning effort, and message language (Chinese / English); defaults to following the model selected for the session.
  • Diff exclusion rules: in Settings → AI assistant, one rule per line, e.g. dist/**, **/*.map, with exceptions like !dist/important.js. Matching files contribute file information only, without reading the diff body, and actual commits are unaffected; common artifacts and large files are summarized by default.

Reading diffs

The diff view supports: ignore whitespace, word-diff (highlighting changed words inline), switching the diff algorithm (default / histogram / patience), and context line count. These options only affect the display and never change repository contents.

Settings and diagnostics

Plugin settings are grouped by scope: General (local Git and editor paths, interface switches, diff display), Sync (background Fetch), Current repository (commit identity, authentication and remotes, local ignore rules), AI assistant, Git LFS, and Diagnostics. The first two groups affect only this machine, and switching repositories does not change their meaning.

  • Add-workspace entry: uses this plugin's chooser (new project / local directory / clone) by default. After turning it off in Settings → Git → General → Interface and entry points, the entry opens the system directory picker directly; re-enable it to restore the chooser.
  • Output module: records every Git command the plugin ran, with exit code, duration, and stdout/stderr — check here first when troubleshooting.
  • Diagnostics: shows Git and Node versions, capability detection per repository, and cache status.

Notes

  • Configure a Git user name and email before committing; remote authentication follows your Git credential manager or SSH configuration.
  • AI features require an available model service in DSH; ordinary Git operations do not depend on AI.
  • Git LFS features require Git LFS to be installed separately.
  • When connected to a remote DSH, file operations, Git, and external editors all run on the remote machine.
  • If functionality reports as not yet loaded after an update, reload the Git plugin Host or restart DSH; refreshing the page alone does not update the Host.

Maintainers

See the release guide for version publishing and npm authorization.

Feedback

Source: GitHub · Issues: Issues

When filing an issue, please include the plugin version, Git version, reproduction steps, and relevant error messages. Failed commands can be viewed in the plugin's "Output".

License

MIT

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.