https://github.com/mohamedawnallah/generic-git-hooks
Generic Git Hooks are the git hooks I generally re-use in my day-to-day work that help me follow the contribution guidelines across many open source projects.
https://github.com/mohamedawnallah/generic-git-hooks
git githooks
Last synced: 2 months ago
JSON representation
Generic Git Hooks are the git hooks I generally re-use in my day-to-day work that help me follow the contribution guidelines across many open source projects.
- Host: GitHub
- URL: https://github.com/mohamedawnallah/generic-git-hooks
- Owner: mohamedawnallah
- License: mit
- Created: 2024-03-31T15:04:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-01T04:50:09.000Z (over 2 years ago)
- Last Synced: 2024-05-02T04:31:46.393Z (about 2 years ago)
- Topics: git, githooks
- Language: Shell
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Generic Git Hooks
These Git hooks are designed to streamline the contribution process by enforcing various guidelines commonly found across open-source projects. By integrating these hooks into your workflow, you can ensure consistency and adherence to contribution standards, saving time and effort in the development process.
## Features
- **Commit-msg Hooks**: Enforce commit message conventions to maintain a clean and informative commit history.
- **Post-checkout Hooks**: Trigger actions after a checkout has been completed, such as updating dependencies or resetting project state.
- **Post-commit Hooks**: Execute tasks automatically after a commit has been made, such as generating documentation or running tests.
## Installation
1. Clone this repository to your local machine:
```bash
git clone https://github.com/mohamedawnallah/generic-git-hooks.git
```
2. Navigate to the cloned repository directory:
```bash
cd generic-git-hooks
```
3. Copy the hooks you wish to use to your project's `.git/hooks` directory:
```bash
cp hooks/commit-msg /path/to/your/project/.git/hooks/
cp hooks/post-checkout /path/to/your/project/.git/hooks/
cp hooks/post-commit /path/to/your/project/.git/hooks/
```
4. Make the hooks executable:
```bash
chmod +x /path/to/your/project/.git/hooks/commit-msg
chmod +x /path/to/your/project/.git/hooks/post-checkout
chmod +x /path/to/your/project/.git/hooks/post-commit
```
## Usage
Once installed, the hooks will automatically execute at their respective stages in the Git workflow. Any violations or issues detected by the hooks will prevent the corresponding action (commit or push) from proceeding until resolved.
To customize the behavior of the hooks, you can edit the scripts directly or modify them to suit your project's specific requirements.
## Contributing
Contributions are welcome! If you have suggestions, improvements, or additional hooks to share, please feel free to open an issue or pull request on GitHub.
## License
This project is licensed under the [MIT License](LICENSE).