Yangi-252410/dsh-import-repositories ↗★ 0
dsh-git-tools
Git tools and /git slash commands for DeepSeek Harness, running git in the Host process so push, pull and fetch work even when the session shell is sandboxed. 适合在沙箱环境中仍需进行代码提交、拉取等Git操作的用户。
Other repositories with this package name
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Yangi-252410/dsh-import-repositoriesREADME
Read the full README ↗提供的斜杠命令(人类使用)
在输入框直接输入即可,不经过模型,在宿主进程中执行 git:
| 命令 | 选项 | 是否联网 |
|---|---|---|
/git | — | 否 |
/git-status | cwd= | 否 |
/git-diff | --staged rev= cwd= | 否 |
/git-log | n cwd= | 否 |
/git-commit | --all --amend `` cwd= | 否 |
/git-fetch | --prune remote= cwd= | 是 |
/git-pull | --rebase remote= branch= cwd= | 是 |
/git-push | --set-upstream remote= branch= cwd= | 是 |
/git-name-set | name= email= remote= cwd= | 否 |
/git-tag-show | [version] cwd= | 否 |
/git-tag | `` [] message= rev= cwd=;或 --push [version] [] | 是 |
每一个命令都支持 cwd=,用于指定仓库所在目录(见下方「关于仓库定位」)。
参数类型约定
| 记号 | 含义 | 例子 |
|---|---|---|
| `` | 必填值 | `` |
[x] | 可选 | [cwd=] |
--flag | 开关,写了就生效,不带值 | --staged |
key= | 键值对,必须带 = | cwd=D:\repo |
⚠️ 值参数漏掉 = 会失效:cwd=D:\repo ✅;cwd D:\repo ❌(被当成两个无关的词)。
/git-name-set:配置提交身份与仓库指向
一次性设置提交身份,并可选地把当前仓库指向另一个远端地址:
/git-name-set name=ZhangSan email=zhangsan@example.com
/git-name-set name=ZhangSan email=zhangsan@example.com remote=https://github.com/zhangsan/repo.git
| 参数 | 必填 | 写入位置 | 作用范围 |
|---|---|---|---|
name= | ✅ | git config --global user.name | 全机器所有仓库 |
email= | ✅ | git config --global user.email | 全机器所有仓库 |
remote= | — | 目标仓库的 origin(remote set-url) | 仅该仓库 |
cwd= | — | — | 指定要改远端的仓库 |
两点必须理解清楚:
- 身份是全局的,不是临时的。
git config --global写入~/.gitconfig, 之后本机所有仓库的提交都用这个名字和邮箱。想只影响单个仓库,请手动用git config --local。 remote=必须填 URL,不能填远端名。 填remote=upstream会被拒绝, 因为这是"远端名"而非地址。它的作用是改变这个仓库推送的目标地址, 而不是新建一个远端。
所有校验都在写入之前完成:参数有误时不会有任何副作用(不会写配置、不会改 remote)。
示例:
/git 列出全部命令与用法
/git-status
/git-commit 修复登录跳转
/git-commit --all 批量更新文档
/git-push --set-upstream
/git-pull --rebase
/git-diff --staged
也支持 key=value 形式的选项,用于覆盖默认值:
/git-status cwd=D:\some\other\repo
/git-push remote=upstream branch=release
/git-diff rev=origin/main...HEAD
关于仓库定位:命令默认以「会话工作目录」为仓库根。如果该目录本身不是仓库
(例如工作区指向 D:\Githubrep 而仓库在其子目录),命令会返回一条明确提示,
此时用 cwd= 指向真正的仓库,或直接把工作区改到仓库根目录。