Git repository connector for DeepSeek Harness: saved repo profiles addressed by name, work-copy operations (clone/fetch/pull/push/commit), Gitea/Forgejo/GitHub API tools, keys in the DSH credential center, and per-repo safety flags (TLS bypass, overwrite, force push).
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Sycada/dsh-git-connector
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
A Git repository connector for DeepSeek Harness: save Gitea / Forgejo / GitHub providers and repo profiles, let the agent reach a repository by profile name, and authorise dangerous behaviours (skip TLS verification, allow overwrites) per repository.
Keys live in the DSH credential center (~/.dsh/.credentials.yaml); plugin data holds only the
reference name - never the secret itself.
Relationship to the community plugin
This plugin focuses on git transport + forge APIs and targets Gitea / Forgejo / self-hosted
instances, with GitHub support as well. The community dsh-github-connector focuses on GitHub
pull-request review and merge flows. They are complementary and can coexist.
Prerequisites
| Item | Requirement |
|---|---|
| Node | >= 20 |
| DSH | >= 0.2.0-rc.1 <0.3.0-0 |
| git | a usable git executable (see below) |
The plugin performs all of its transport work (clone / fetch / pull / push) by invoking the git
command line, not by embedding a git library - so a git binary must be reachable on the host.
Installing git
Windows
winget install --id Git.Git -e
You can also use the installer from https://git-scm.com/download/win.
macOS
brew install git
# or: xcode-select --install
Linux
sudo apt install git # Debian / Ubuntu
sudo dnf install git # Fedora / RHEL
sudo pacman -S git # Arch
Verify
git --version
If git is not on PATH
Pick either method:
- Settings page (recommended, changeable at runtime): Settings -> Plugins -> Git Connector -> Git executable path
- Profile config:
gitPathincordis.patch.yml
gitPath: "C:\\Program Files\\Git\\cmd\\git.exe" # Windows example
# gitPath: "/usr/local/bin/git" # macOS / Linux example
Resolution order: settings page > profile config > auto-detection (PATH first, then the
platform's common install locations). Leaving the settings field empty restores auto-detection.
Install
Add the dependency to your DSH profile and register the bundle:
"dependencies": {
"dsh-git-connector": "https://github.com/Sycada/dsh-git-connector.git#main"
},
"dsh": {
"profile": {
"bundles": [ ..., "dsh-git-connector" ]
}
}
The plugin has no runtime dependencies: git is invoked as a subprocess and HTTP uses Node's
built-in node:https.
Quick start
1. Add a provider
@ git_provider_add { name: "my-gitea", kind: "gitea", baseUrl: "https://git.example.com", username: "alice" } @
The credential reference DSH_GIT_CONNECTOR_MY_GITEA_TOKEN is derived automatically.
2. Store the key
Open Settings -> Plugins -> Git Connector, paste the token on the provider row and press
Save key. You may also write ~/.dsh/.credentials.yaml directly or use an environment
variable of the same name.
Verify with:
@ git_provider_test { provider: "my-gitea" } @
3. Add a repo profile
@ git_repo_add { name: "my-project", providerRef: "my-gitea", owner: "alice", repo: "my-project" } @
The remote URL is derived from gitBaseUrl + owner/repo.
4. Work by profile name
@ git_clone { repo: "my-project" } git_status { repo: "my-project" } git_commit { repo: "my-project", message: "feat: ..." } git_push { repo: "my-project" } @
Every later operation uses the profile name only - the agent never needs the URL, the credentials or the local path.
Tools
| Group | Tools |
|---|---|
| Providers | git_provider_list git_provider_add git_provider_update git_provider_remove git_provider_test |
| Repo profiles | git_repo_list git_repo_add git_repo_update git_repo_remove |
| Git operations | git_clone git_fetch git_pull git_push git_status git_branch git_diff git_log git_commit |
| Tags | git_tag git_tag_verify forge_tag_list forge_tag_create |
| Forge API | forge_repo_list forge_repo_create forge_repo_info forge_branch_list forge_branch_create forge_branch_delete forge_contents forge_pull_list forge_pull_create forge_issue_create |
| Credentials | git_credential_status |
Publishing a tag
Pushing refs/tags/... over the git transport fails authentication on some Gitea instances, so
create the tag through the forge API:
forge_tag_create { repo: "my-project", tag: "v0.2.0", target: "main", message: "..." }
git_tag_verify { repo: "my-project", name: "v0.2.0" } # confirm it reached the remote
On Gitea/Forgejo, release: true also creates a Release. GitHub needs two requests (a tag object
then a ref); the adapter absorbs that difference so the arguments stay identical. Tags are not
subject to the four force-push gates (a tag is a release marker, not a branch that can lose
commits), but readOnly still applies.
Profile management and execution are kept strictly apart: git_repo_* only maintains profiles,
git_* acts on a repository.
Per-repo flags
Effective value = repo.flags[key] -> provider field -> global config -> built-in default.
| Flag | Default | Effect |
|---|---|---|
insecureTls |
inherits provider/global (false) | Skip certificate verification (escape hatch for self-signed hosts; prefer caFile) |
caFile |
inherits provider | Verify with a PEM file (safer than insecureTls) |
overwriteLocal |
false (repo-only) | Destroy local work-copy state: clone into a non-empty directory (backup first), pull discarding changes (stash first), delete an unmerged branch (SHA recorded) |
overwriteRemote |
false (repo-only) | Rewrite remote history (force push) |
allowForcePush |
inherits global (false) | First gate for force push |
allowForceDefaultBranch |
false (repo-only) | Permit force-pushing the default branch |
allowOutsideWorkspace |
inherits global (false) | Permit localPath outside the workspace root |
readOnly |
false (repo-only) | Reject every write operation |
fetchPrune |
true | Pass --prune to fetch |
commitIdentity |
inherits global instanceLabel |
Commit author tag |
The overwrite rule
With overwriteLocal enabled, every destructive operation returns something you can roll back
to (a backup directory path, stash@{0}, a deleted branch SHA, a previous remote SHA). There is
no path where flipping a switch silently loses data.
A force push requires four gates open at once:
@ global.allowForcePush AND repo.flags.allowForcePush AND repo.flags.overwriteRemote AND the call passes confirmForce: true (and the target must not be the default branch unless allowForceDefaultBranch is on) @
Security
| Concern | Approach |
|---|---|
| Key storage | Only the reference name is stored; the value lives in the DSH credential center |
| Key injection | A throwaway GIT_ASKPASS helper per operation; the value travels via the environment - not argv, not the URL, never on disk; removed when the command ends and swept on startup after a crash |
| Subprocess discipline | Only spawn(git, argv[]) - never a shell string |
| Credential helper | credential.helper is reset per call, so the system credential manager never sees or caches the token |
| TLS | Verified by default; insecureTls builds a one-request agent and never mutates process-wide TLS state |
| SSRF | allowRawUrl is off: without a provider you cannot connect an arbitrary URL |
| Path fence | localPath must stay inside workspaceRoot unless the profile opts out |
| Browser fence | The settings API is reachable from loopback (or trustedHosts) only |
| Commit identity | Commits are authored as dsh-git-connector[<instanceLabel>], distinguishable from the user's and other agents' |
Configuration
gitPath: "" # custom git binary; empty = auto-detect
gitTimeoutMs: 300000 # per-command timeout
gitOutputLimit: 1048576 # stdout/stderr cap in bytes
workspaceRoot: "" # work-copy root; empty = ~/.dsh/dsh-git-connector/workspaces
allowOutsideWorkspace: false
allowForcePush: false
allowRawUrl: false
allowInsecure: false
httpTimeoutMs: 30000
maxOutputLines: 2000
promptSectionOrder: 570
instanceLabel: "" # commit tag, e.g. "desktop-1"
trustedHosts: []
License
MIT
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-git-graph★ 10686
Git branch selector and Git graph for the dsh web GUI: switch branches and explore branch-lane and commit history from the conversation header. Retired by the author in favour of the official workspace-changes plugin: the published npm package stays installable but is no longer developed.
Akimiya-z/codex-guard#dsh★ 131
Pre-submit pull-request hygiene checks inside DeepSeek Harness: scans the current diff for TODO leftovers, hardcoded secrets, and non-conventional commit subjects.
xbzbing/dsh-git-panel★ 65
IDE-style Git panel in the DSH Web GUI: a resident tab with a three-column overview (branch/tag list, searchable commit-history graph, commit detail with changed-file tree and message) and a changes page (stats bar, uncommitted list with per-file stage/unstage/discard, commit box with amend); side-by-side diffs carry lazy highlight.js syntax highlighting, on-demand between-hunk context expansion and word-level intra-line emphasis, with image files shown as before/after panes; plus a zsh-style branch marker in the input bar. Every git command runs as an argv array through the host subprocess service, cwd locked to the repo root.
Cerbur/clutch-dsh#clutch-dsh-worktree★ 49
Adds a Worktree view to DSH Web UI that groups Sessions by Git worktree while keeping DSH as the source of truth.
KannaKuron/dsh-ide-git★ 41
JetBrains-style Git tool window for the sidebar: branch tree with ahead/behind badges, commit graph with text/author/date/path filters, per-file line diff, changes list and commit box, plus branch, tag and stash actions, merge, rebase, cherry-pick, reset and fetch/pull/push.
Lenonss/DSH_VsCodeMode★ 36
VSCode-style editing experience for DeepSeek Harness: a Monaco-based central file editor (tabs, Ctrl+P quick open, status bar) and interactive diff review of agent edit/write results with per-change Keep/Undo, rollback and archiving, persisted across restarts.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.