A command-line tool that generates a comprehensive CSV file comparing files between two Git commits. This tool helps you analyze changes between commits by providing detailed information about file types, sizes, and modification dates.
- Compare files between any two Git commits
- Generate a structured CSV report with detailed file information
- Track file additions, modifications, and deletions
- Compare file sizes between commits
- Include custom remarks in the generated report
- Cross-platform support (Linux, macOS, Windows)
go install github.com/j03hanafi/gitdiff@latest- Visit the Releases page
- Download the appropriate binary for your operating system:
- Linux:
gitdiff_Linux_x86_64.tar.gzorgitdiff_Linux_arm64.tar.gz - macOS:
gitdiff_Darwin_x86_64.tar.gzorgitdiff_Darwin_arm64.tar.gz - Windows:
gitdiff_Windows_x86_64.ziporgitdiff_Windows_arm64.zip
- Linux:
- Extract the archive and place the binary in your PATH
Navigate to your Git repository and run:
gitdiff --from <past-commit> --to <current-commit>Example:
cd /path/to/your/repo
gitdiff --from abc123 --to def456You can add a custom remark to the generated CSV file:
gitdiff --from <past-commit> --to <current-commit> --remark "Sprint 42 changes"| Option | Description | Required |
|---|---|---|
--from |
The base commit hash to compare from | Yes |
--to |
The target commit hash to compare to | Yes |
--remark |
Custom remark to include in the CSV output | No |
--help |
Display help information | No |
The tool generates a CSV file named diff_<from-commit>_<to-commit>.csv with the following structure:
- Header row with commit identifiers (first 5 characters of each commit hash)
- Column headers for both commits:
- No (sequential number)
- File Name (path to the file)
- File Type (file extension)
- Date Modified (commit date in "DD MMM YYYY" format)
- File Size (in KB)
- Remark (custom remark if provided)
Example CSV output:
,from,abc12,,,to,def45
No,File Name,File Type,Date Modified,File Size (KB),No,File Name,File Type,Date Modified,File Size (KB),Remark
1,src/main.go,.go,01 Jan 2023,12.50,1,src/main.go,.go,15 Jan 2023,13.20,Sprint 42 changes
2,README.md,.md,01 Jan 2023,1.20,2,README.md,.md,15 Jan 2023,2.40,Sprint 42 changes
- The tool uses Git commands to identify files that changed between the specified commits
- It checks out each commit to analyze file details (size, type, etc.)
- It compiles all information into a structured CSV report
- The CSV file is saved in the current directory
- Git must be installed and accessible in your PATH
- If building from source: Go 1.19 or later
Contributions are welcome! Feel free to open issues or submit pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
- Built with Go
- Released using GoReleaser