---
title: "在 Windows 为 DSH 配置 Git Bash Shell"
seo_title: "DSH Git Bash 教程：Windows 替换 PowerShell"
description: "介绍 DeepSeek Harness（DSH）安装 dsh-gitbash-shell，配置 bashPath、Git Bash Preset、权限、验证与卸载。"
canonical: https://52dsh.com/tutorials/kannakuron-dsh-gitbash-shell-install-config/
authors: ["52DSH 编辑部"]
audience: []
outcomes: []
prerequisites: ["Node.js 与 pnpm","独立 web Profile","可丢弃测试工作区"]
difficulty: advanced
estimated_action_time: null
next_steps: null
published_at: 2026-08-29
updated_at: 2026-08-29
verified_on: 2026-08-29
maintenance_status: community
verification_level: source_reviewed
risk_level: high
dsh_version: 0.1.1-rc.2
plugin_id: kannakuron-dsh-gitbash-shell
tutorial_kind: plugin_configuration
related_plugin_url: https://52dsh.com/plugins/kannakuron-dsh-gitbash-shell/
---

# 在 Windows 为 DSH 配置 Git Bash Shell

介绍 DeepSeek Harness（DSH）安装 dsh-gitbash-shell，配置 bashPath、Git Bash Preset、权限、验证与卸载。

在 Windows 上用明确的 Git for Windows bash.exe 替代 PowerShell 执行器，并生成四种 Git Bash Agent Preset。

如果你的目标是在 Windows 上让 DSH 使用 Git Bash 而不是 PowerShell，本教程会说明如何在 DeepSeek Harness（DSH）中准备、安装、配置、验证和回退 dsh-gitbash-shell。本文锁定作者仓库提交 `99f2f45fca38`；已复核固定提交的原始资料，未进行运行实测。

> 对应插件：[查看 dsh-gitbash-shell 的功能、权限与兼容性说明](/plugins/kannakuron-dsh-gitbash-shell/)。先确认它适合你的工作流，再执行安装。

## 先确认是否适合你

- **分类**：编程与代码开发
- **风险等级**：high
- **核验证据**：source_reviewed
- **兼容性边界**：0.6.0 源码分别携带 DSH 0.1.1 与 0.1.2+ 的 preset 组合并按内置 roster 选择；这属于作者实现证据，52DSH 未在 Windows 或 0.1.2-alpha.1 上运行
- **主要权限关注**：替换 Profile 的 Shell 执行器、启动 Git Bash 子进程、物化或清理用户 preset 目录，并可修改 Better Sidebar 的 terminalShell 设置

如果你准备在重要工作区使用，先阅读插件详情页的权限和数据流说明；“源码已审阅”或“资料已整理”都不等于安全认证。

## 安装前准备

1. 安装 Node.js 22.19、Node.js 24 或项目当前声明支持的更高版本，并确认 `pnpm` 可用。
2. 使用独立的 `web` Profile 和可丢弃测试工作区，不直接连接生产目录。
3. 备份当前 Profile 配置，并记录安装前的 `--dump-config` 输出。
4. 核对固定来源中的外部服务、账号、运行时和平台限制。
5. 作者资料未显示明确的插件专属环境变量；如果运行时要求凭据，不要根据同类插件猜测变量名。

## 安装 dsh-gitbash-shell

52DSH 使用目录中记录的精确安装目标，避免直接跟随可能变化的默认分支：

```bash
npx --yes @deepseek-ai/dsh@0.1.1-rc.2 plugin --profile web add github:KannaKuron/dsh-gitbash-shell#99f2f45fca38
```

GitHub 源码插件如果被 pnpm 拦截构建脚本，先检查终端提示的具体包和脚本。只在 `web` Profile 中放行确实需要的构建项，不要全局放行未知依赖。

作者文档还出现了以下命令。它们用于核对功能或开发流程，不应替换上面的锁定安装命令，也不要一次全部执行：

- `dsh plugin --profile web add dsh-gitbash-shell`
- `dsh plugin --profile web remove dsh-gitbash-shell`

## 插件专属配置

### 配置目标

- `$DSH_HOME/profiles/web/cordis.patch.yml`：选择物化的 Git Bash Preset、bashPath、超时和 Better Sidebar 联动。

### 只启用两个 Preset 并指定 Git Bash

证据：[固定来源](https://github.com/KannaKuron/dsh-gitbash-shell/blob/99f2f45fca38a43f5da1e1b8c0dc7e75edfb104d/README.md)。将路径、账号和凭据占位符替换为测试值。

```yaml
- id: gitbash-presets
  config:
    presets: [standard-gitbash, minimal-gitbash]
- id: gitbash-executor
  config:
    bashPath: 'C:/Program Files/Git/bin/bash.exe'
    timeoutMs: 60000
    betterSidebarShell: false
```

### 安装后设置

1. 重启 web Profile，新建会话并显式选择 standard-gitbash。
2. 确认托管 preset 未覆盖已有用户修改；Better Sidebar 联动先保持关闭。


## 配置验证与成功结果

1. **在测试会话查看工具名并查询 Bash 版本。**

   ```bash
   echo $BASH_VERSION && command -v bash
   ```

   期望结果：出现 bash 工具，路径指向 Git for Windows，不是 System32。

## 第一次使用

- 在空测试仓库运行 pwd、git status 和只读文件列表，不执行安装脚本或写操作。

## 数据、权限与凭据

**数据流：**DSH Shell 工具调用与环境变量 → 指定的 Git Bash bash.exe → 官方 bash-sandbox 或 full-access 执行路径 → 命令输出返回 Agent；preset 文件写入用户信任目录。

**权限关注：**替换 Profile 的 Shell 执行器、启动 Git Bash 子进程、物化或清理用户 preset 目录，并可修改 Better Sidebar 的 terminalShell 设置

**数据存储：**插件会在首个用户信任 preset 根目录写入带 .plugin-managed.json 哈希标记的托管目录。

真实 Token、API Key、Cookie 和账号 ID 不应写进 Git 仓库、网页截图或公开 Issue。测试结束后撤销临时凭据。

## 卸载、回退与清理

1. 从同一 Profile 移除插件并重启。
2. 确认未修改的 *-gitbash preset 被清理；用户改过的目录由插件保留，需人工决定是否删除。

## 常见问题

### 安装成功但页面或命令没有出现

先运行 `--dump-config` 确认 Bundle 已进入 `web` Profile，再重启 DSH Web 并硬刷新浏览器。不要通过反复扩大权限来解决加载问题。

### 插件运行后没有得到预期结果

把问题缩小到本页的最小验证任务，检查作者文档要求的变量、外部服务和平台限制。保存终端错误原文，并核对当前安装目标是否仍对应本页固定提交。

作者固定资料中未识别到独立故障章节。遇到插件特有错误时，应先停止 DSH、保留日志并回退插件。

## 固定来源证据

以下资料是本文配置结论的依据：

- [README.md](https://github.com/KannaKuron/dsh-gitbash-shell/blob/99f2f45fca38a43f5da1e1b8c0dc7e75edfb104d/README.md)

继续查看：[返回 dsh-gitbash-shell 插件详情页](/plugins/kannakuron-dsh-gitbash-shell/)，重新核对兼容性、权限、同类插件和来源状态。

## 原始来源

- https://github.com/KannaKuron/dsh-gitbash-shell
- https://github.com/KannaKuron/dsh-gitbash-shell/blob/99f2f45fca38a43f5da1e1b8c0dc7e75edfb104d/README.md
