# git-diff-exporter **Repository Path**: izenvip/git-diff-exporter ## Basic Information - **Project Name**: git-diff-exporter - **Description**: 比较两个不同的GIT版本并自动打包 https://www.lvtao.net/tool/git-diff.html - **Primary Language**: TypeScript - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-31 - **Last Updated**: 2026-03-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: VSCode ## README ![安装](a_1.jpg) ![使用](a_2.jpg) # Git Diff Exporter A VSCode extension that helps you export files between two git commits as a compressed archive. ## Features - **Status Bar Integration**: Click the status bar item to quickly access the Git Diff Exporter menu - **Smart Commit Selection**: Select two commits easily with visual feedback - **Export Changed Files**: Export all changed files between commits as a tar.gz archive - **Custom Output Location**: Choose where to save your exported archive - **Visual Progress**: See real-time progress during export ## Usage ### Quick Start 1. Open a git repository in VSCode 2. Click the **"Select Commits"** button in the status bar (bottom left) 3. Select the first commit (older version) 4. Select the second commit (newer version) 5. Click **"Export Now"** when prompted 6. Choose the output location for the archive ### Right-Click Menu (Recommended) You can also select commits directly from the Git view: 1. Open the **Source Control** view (Ctrl+Shift+G) 2. Right-click on any commit or file 3. Choose **"Set as First Commit (Start)"** to set the starting commit 4. Right-click on another commit or file 5. Choose **"Set as Second Commit (End)"** to set the ending commit 6. Click **"Export Now"** when prompted 7. Choose the output location for the archive ### Alternative Method 1. Open a git repository in VSCode 2. Press `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux) to open the Command Palette 3. Type "Export Git Diff" or "Show Git Diff Exporter Menu" 4. Follow the on-screen instructions ### Status Bar States - **⭕ Select Commits**: No commits selected yet - **📦 abc12345 → ?**: First commit selected, waiting for second commit - **📦 abc12345 → def67890**: Both commits selected, ready to export (highlighted) ## Requirements - Git must be installed and available in your system PATH - A git repository must be open in VSCode ## Installation ### From VSIX File 1. Download the `.vsix` file 2. Open VSCode 3. Go to Extensions (Cmd+Shift+X) 4. Click the `...` menu 5. Select "Install from VSIX..." 6. Choose the downloaded `.vsix` file ### From Source 1. Clone this repository 2. Run `npm install` to install dependencies 3. Run `npm run compile` to compile the TypeScript code 4. Run `npm run package` to create the `.vsix` file 5. Install the generated `.vsix` file ### Development Mode 1. Clone this repository 2. Run `npm install` to install dependencies 3. Run `npm run compile` to compile the TypeScript code 4. Press `F5` to launch the extension in a new VSCode window ## Configuration You can configure a default output path in your VSCode settings: ```json { "gitDiffExporter.defaultOutputPath": "/path/to/default/output" } ``` ## How It Works 1. The extension displays a status bar item showing the selected commits 2. Click the status bar item to open the menu 3. Select commits from the dropdown list (shows recent 50 commits) 4. Once both commits are selected, you can export the diff 5. The extension uses `git diff` to find changed files 6. Files are packaged into a tar.gz archive at your chosen location ## 中文说明 ### 简介 Git Diff Exporter 是一个 VSCode 扩展,帮助您将两个 git 提交之间的文件导出为压缩包。 ### 功能特性 - **状态栏集成**:点击状态栏项快速访问 Git Diff Exporter 菜单 - **智能提交选择**:通过可视化反馈轻松选择两个提交 - **导出变更文件**:将提交之间的所有变更文件导出为 tar.gz 压缩包 - **自定义输出位置**:选择保存导出压缩包的位置 - **可视化进度**:导出过程中显示实时进度 ### 使用方法 #### 快速开始 1. 在 VSCode 中打开一个 git 仓库 2. 点击状态栏(左下角)的 **"Select Commits"** 按钮 3. 选择第一个提交(较旧的版本) 4. 选择第二个提交(较新的版本) 5. 出现提示时点击 **"Export Now"** 6. 选择压缩包的输出位置 #### 右键菜单(推荐) 您也可以直接从 Git 视图中选择提交: 1. 打开 **源代码管理** 视图(Ctrl+Shift+G) 2. 右键点击任意提交或文件 3. 选择 **"Set as First Commit (Start)"** 设置起始提交 4. 右键点击另一个提交或文件 5. 选择 **"Set as Second Commit (End)"** 设置结束提交 6. 出现提示时点击 **"Export Now"** 7. 选择压缩包的输出位置 #### 状态栏状态说明 - **⭕ Select Commits**:尚未选择提交 - **📦 abc12345 → ?**:已选择第一个提交,等待选择第二个提交 - **📦 abc12345 → def67890**:两个提交都已选择,准备导出(高亮显示) ### 系统要求 - Git 必须已安装并在系统 PATH 中可用 - VSCode 中必须打开一个 git 仓库 ### 安装方法 #### 从 VSIX 文件安装 1. 下载 `.vsix` 文件 2. 打开 VSCode 3. 进入扩展视图(Cmd+Shift+X) 4. 点击 `...` 菜单 5. 选择 "Install from VSIX..." 6. 选择下载的 `.vsix` 文件 #### 从源码安装 1. 克隆此仓库 2. 运行 `npm install` 安装依赖 3. 运行 `npm run compile` 编译 TypeScript 代码 4. 运行 `npm run package` 创建 `.vsix` 文件 5. 安装生成的 `.vsix` 文件 ### 配置 您可以在 VSCode 设置中配置默认输出路径: ```json { "gitDiffExporter.defaultOutputPath": "/path/to/default/output" } ``` ### 工作原理 1. 扩展在状态栏显示一个项,显示已选择的提交 2. 点击状态栏项打开菜单 3. 从下拉列表中选择提交(显示最近 50 个提交) 4. 选择两个提交后,即可导出差异 5. 扩展使用 `git diff` 查找变更的文件 6. 文件被打包成 tar.gz 压缩包,保存到您选择的位置 ## License MIT