https://github.com/julienloizelet/githooks
Some reusable githooks
https://github.com/julienloizelet/githooks
Last synced: 3 months ago
JSON representation
Some reusable githooks
- Host: GitHub
- URL: https://github.com/julienloizelet/githooks
- Owner: julienloizelet
- License: mit
- Created: 2024-02-08T01:37:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-19T01:47:57.000Z (9 months ago)
- Last Synced: 2025-01-14T13:33:10.208Z (4 months ago)
- Language: Shell
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Git hooks
---
> Some reusable git hooks
---
- [Usage](#usage)
- [Per repository usage](#per-repository-usage)
- [Global usage](#global-usage)
- [Hooks](#hooks)
- [commit-msg](#commit-msg)
- [License](#license)
- [Contribute](#contribute)## Usage
### Per repository usage
- Clone this repository
- copy a hook in the `.git/hooks` folder of your project
- make it executable if necessary: `chmod +x .git/hooks/`### Global usage
See https://stackoverflow.com/a/37293198/7497291
**!!Warning!!** setting global hooks path disables all local hooks in your repos
- Clone this repository in some `/path/to/the/clone/` folder.
- make it executable if necessary: `chmod +x /path/to/the/clone/hooks/`
- `git config --global core.hooksPath /path/to/the/clone/hooks` (use `core.hookspath` on Mac OS )## Hooks
### commit-msg
Check if the commit message follows a custom format.
This format is slightly different from the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format:
- The type is mandatory and must be one of the following:
- `feat`: a new feature
- `fix`: a bug fix
- `docs`: documentation only changes
- `style`: changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- `refactor`: a code change that neither fixes a bug nor adds a feature
- `ci`: changes to CI configuration files and scripts
- `test`: adding missing tests or correcting existing tests
- `chore`: changes to the build process or auxiliary tools and libraries such as documentation generation
- `comment`: changes that only affect comments- The scope is mandatory (wildcard `*` is allowed)
- Last sentence must start with uppercased letter
- An optional prefix is allowed and must respect the following format:
- `(#XXXX)`: where `XXXX` is an integer (related to an issue for example)## License
[MIT](LICENSE)
## Contribute
Anyone is welcome to submit a pull request to this repository.
**Contributed and maintained by [julienloizelet](https://github.com/julienloizelet)**