Skip to content

快速开始

本指南将帮助你在 5 分钟内开始使用 Git Doctor。

环境要求

依赖项版本要求说明
VS Code>= 1.85.0必需
Node.js>= 16.x必需
Git已安装必需
DeepSeek/Kimi API Key-可选,用于 AI 功能

安装方式

方式一:VSIX 安装(推荐)

  1. 下载项目根目录的 git-doctor-1.0.0.vsix 文件
  2. 在 VS Code 中按 Ctrl+Shift+P 打开命令面板
  3. 输入 Extensions: Install from VSIX...
  4. 选择 VSIX 文件完成安装
  5. 重启 VS Code

方式二:从源码构建

bash
# 克隆项目
git clone https://github.com/git-doctor/git-doctor.git
cd git-doctor

# 安装依赖
npm install

# 编译
npm run compile

# 打包 VSIX
npm run package

方式三:CLI 命令行

bash
# 全局安装
npm install -g git-doctor

# 查看帮助
git-doctor --help

第一次诊断

VS Code 插件

  1. 打开任意 Git 仓库项目
  2. 点击侧边栏的 Git Doctor 图标(脉搏图标)
  3. 点击 运行诊断 按钮

或使用命令面板:

  • Ctrl+Shift+P
  • 输入 Git Doctor: 运行完整诊断

CLI 命令行

bash
# 进入 Git 仓库目录
cd your-project

# 运行完整诊断
git-doctor analyze

# 查看各项分析
git-doctor size      # 仓库体积
git-doctor commits   # 提交质量
git-doctor branches  # 分支健康
git-doctor security  # 敏感信息

诊断结果

诊断完成后,你将看到:

┌─────────────────────────────────────────┐
│  健康概览                                │
├─────────────────────────────────────────┤
│  📊 健康评分: 85/100                     │
│                                         │
│  📦 仓库体积: 12.5 MB                    │
│  📝 提交规范率: 78%                      │
│  🌿 僵尸分支: 2                          │
│  🔒 安全风险: 2 (中)                     │
└─────────────────────────────────────────┘

下一步

基于 MIT 许可发布