This repository provides various useful Git Hooks written in Python.
This project was initially created to answer this issue on StackOverflow.
The needs was to prevent merging from 'testing' branch in something else than the 'master' one.
If you need to learn Git Hook, check the official Git Book
You can easily integrate with various code hosting platform, for instance:
To fit PEP8 Style Guide, file name uses _
instead of -
, and .py
extension.
You just need to download the hook(s) you want, and put them in the .git/hooks/ sub-directory of your repository.
When moving file to your .git/hooks/ sub-directory, you then must rename the file accordingly, to fit what Git awaits.
For this feature, you need the prepare_commit_msg.py hook.
Installation:
- copy file to the .git/hooks/ sub-directory of your repository, and rename it to prepare-commit-msg
- edit configuration at beginning of the hook to match your source/destination branches rules
Don't hesitate to contribute or to contact me if you want to improve the project.
You can report issues or request features and propose merge requests.
The versioning scheme we use is SemVer.
This project is under the GPLv3 License - see the LICENSE file for details.