Skip to content

bertrand-benoit/pyGitHook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

⚠️ This project is now hosted on Gitlab; switch to it to get newer versions.

pyGitHook

Codacy Badge

This repository provides various useful Git Hooks written in Python.

History

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.

References

If you need to learn Git Hook, check the official Git Book

You can easily integrate with various code hosting platform, for instance:

Usage

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.

Prevent merging between some branches

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

Contributing

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.

Versioning

The versioning scheme we use is SemVer.

Authors

Bertrand BENOIT

License

This project is under the GPLv3 License - see the LICENSE file for details.

About

Various useful Git Hooks written in Python ⚠️ Now hosted on Gitlab

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages