First off, thank you for considering contributing to git-rewrite-commits! It's people like you that make this tool better for everyone.
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
Before creating bug reports, please check existing issues as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps which reproduce the problem
- Provide specific examples to demonstrate the steps
- Describe the behavior you observed after following the steps
- Explain which behavior you expected to see instead and why
- Include your environment details (OS, Node version, npm version)
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
- Use a clear and descriptive title
- Provide a step-by-step description of the suggested enhancement
- Provide specific examples to demonstrate the steps
- Describe the current behavior and explain which behavior you expected to see instead
- Explain why this enhancement would be useful
- Fork the repo and create your branch from
main - If you've added code that should be tested, add tests
- Ensure the test suite passes
- Make sure your code follows the existing code style
- Issue that pull request!
-
Fork and clone the repository:
git clone https://github.com/f/git-rewrite-commits.git cd git-rewrite-commits -
Install dependencies:
npm install
-
Build the project:
npm run build
-
Run in development mode:
npm run dev -- [options]
git-rewrite-commits/
├── src/
│ ├── index.ts # Main library with GitCommitRewriter class
│ └── cli.ts # CLI entry point
├── dist/ # Compiled JavaScript (generated)
├── package.json # Project metadata and dependencies
├── tsconfig.json # TypeScript configuration
├── README.md # User documentation
└── CONTRIBUTING.md # This file
To test your changes locally:
-
Build the project:
npm run build
-
Run the CLI locally:
node dist/cli.js --help
-
Test with npx:
npx . --help -
Test on a sample repository:
# Create a test repo mkdir test-repo && cd test-repo git init # Create some commits echo "test" > file.txt && git add . && git commit -m "bad message 1" echo "test2" > file2.txt && git add . && git commit -m "bad message 2" # Run the tool in dry-run mode npx .. --dry-run --api-key "your-api-key"
We follow the Conventional Commits specification. Examples:
feat: add support for GPT-4 vision modelfix: handle empty commit messages properlydocs: update installation instructionsrefactor: extract message generation logictest: add tests for backup creationchore: update dependencies
- Update version in package.json
- Create a git tag:
git tag v1.x.x - Push tag:
git push origin v1.x.x - GitHub Actions will automatically publish to npm
Feel free to open an issue with your question or reach out to the maintainers.
Thank you for contributing! 🚀