A PowerShell script that helps you create a zip file containing changes between two Git commits. This tool is particularly useful when you need to package and share specific changes from your Git repository.
- Interactive commit selection from the last 50 commits
- Flexible comparison options:
- Compare any two commits
- Compare a single commit with HEAD
- Customizable output:
- Configurable output directory (defaults to
patch/) - Custom filename support with automatic date stamping
- Choice of line endings (LF or CRLF)
- Configurable output directory (defaults to
- Preserves directory structure of changed files
- UTF-8 encoding support
- Automatic cleanup of temporary files
- Open PowerShell in your Git repository
- Run the script:
.\uncommited_patch_copy.ps1
- Follow the interactive prompts:
- Select commits by their numbers (1-50)
- Choose output directory (optional)
- Specify filename (optional)
- Select line ending format
- Select the first commit (content in this commit won't be included):
Your selection: 3 - Select the second commit:
- Enter a number to select a specific commit
- Press Enter to use HEAD (current state)
- Type 'back' to reselect first commit
Your selection: [Enter for HEAD]
- Press Enter to use default (
patch/) - Or enter a custom path
- Press Enter to use default format:
[oldCommit]_[newCommit]_[date].zip - Or enter a custom filename (
.zipextension will be added automatically)
- Press Enter or
1for LF (Unix/Linux style) - Enter
2for CRLF (Windows style)
The script creates a zip file containing:
- All files changed between the selected commits
- Files maintain their original repository structure
- Line endings normalized according to selection
Default output location: patch/[oldCommit]_[newCommit]_[date].zip
patch/
└── abc123_def456_20250225.zip
├── src/
│ ├── components/
│ │ └── changed-file.js
│ └── utils/
│ └── modified-util.js
└── config/
└── updated-config.json