All Projects → ghooks-org → Ghooks

ghooks-org / Ghooks

Licence: mit
Simple git hooks

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ghooks

elixir git hooks
🪝 Add git hooks to Elixir projects
Stars: ✭ 98 (-90.56%)
Mutual labels:  git-hooks
Git Confirm
❓ Git hook to catch placeholders and temporary changes (TODO / @ignore) before you commit them.
Stars: ✭ 356 (-65.7%)
Mutual labels:  git-hooks
Pre Commit Terraform
pre-commit git hooks to take care of Terraform configurations
Stars: ✭ 902 (-13.1%)
Mutual labels:  git-hooks
git-conventional-commits
Git Conventional Commits Util to generate Semantic Version and Markdown Change Log and Validate Commit Messag
Stars: ✭ 58 (-94.41%)
Mutual labels:  git-hooks
Static Review
✋ An extendible framework for version control hooks.
Stars: ✭ 330 (-68.21%)
Mutual labels:  git-hooks
Komondor
Git Hooks for Swift projects 🐩
Stars: ✭ 450 (-56.65%)
Mutual labels:  git-hooks
rusty-hook
git hook manager, geared toward Rust projects
Stars: ✭ 93 (-91.04%)
Mutual labels:  git-hooks
Git Hooks
github_email_verify: Avoid committing to github with your corporate email
Stars: ✭ 40 (-96.15%)
Mutual labels:  git-hooks
Grumphp
Submitting bugs and feature requests
Stars: ✭ 3,679 (+254.43%)
Mutual labels:  git-hooks
App Githooks
Plugin-based system to run specific actions and checks when git hooks are triggered.
Stars: ✭ 5 (-99.52%)
Mutual labels:  git-hooks
modular-git-hooks
A tool for organizing git hooks into directories of modular files.
Stars: ✭ 19 (-98.17%)
Mutual labels:  git-hooks
git-semantics
Git hook to ensure semantic commit messages.
Stars: ✭ 42 (-95.95%)
Mutual labels:  git-hooks
Fit Commit
A Git hook to validate your commit messages based on community standards.
Stars: ✭ 468 (-54.91%)
Mutual labels:  git-hooks
mestral
Simple hook management for Git
Stars: ✭ 55 (-94.7%)
Mutual labels:  git-hooks
Composer Git Hooks
Easily manage git hooks in your composer config
Stars: ✭ 838 (-19.27%)
Mutual labels:  git-hooks
enforce-git-message
Enforces conventional git commit messages for git repositories
Stars: ✭ 30 (-97.11%)
Mutual labels:  git-hooks
Awesome Git Hooks
😎 A collection of awesome Git Hooks
Stars: ✭ 407 (-60.79%)
Mutual labels:  git-hooks
Wtf
Whitespace Total Fixer
Stars: ✭ 40 (-96.15%)
Mutual labels:  git-hooks
Pivotal Flow
Automate your pivotal workflow
Stars: ✭ 29 (-97.21%)
Mutual labels:  git-hooks
Captainhook
Very flexible git hook manager for php developers
Stars: ✭ 485 (-53.28%)
Mutual labels:  git-hooks

ghooks

version travis build AppVeyor codecov coverage Dependencies status Dev Dependencies status

MIT License downloads semantic-release Commitizen friendly

Simple git hooks

Installation

npm install ghooks --save-dev

It is not advised to install ghooks as a production dependency, as it will install git hooks in your production environment as well. Please install it under the devDependencies section of your package.json.

Please also note, that it is absolutely not advised to install ghooks globally. To work as expected, make it a development dependency of your project(s).

Setup

Add a config.ghooks entry in your package.json and simply specify which git hooks you want and their corresponding commands, like the following:

{
  
  "config": {
    "ghooks": {
      "pre-commit": "gulp lint",
      "commit-msg": "validate-commit-msg",
      "pre-push": "make test",
      "post-merge": "npm install",
      "post-rewrite": "npm install",
      
    }
  }
  
}

Note: The hooks' working directory is relative to the git root (where you have your .git directory). This means that if your package.json is in a subdirectory of your git repository, you'll need to cd into the directory before running any npm scripts. E.g.:

"pre-commit": "cd path/to/folder && npm run test"

opt-in/out

One of the last things you want is to raise the barrier to contributing to your open source project. So Andreas Windt developed the opt-cli package to allow you to turn your hooks into opt-in/out scripts. See this project's package.json for an example of how to do that.

All documented hooks are available

  • applypatch-msg
  • pre-applypatch
  • post-applypatch
  • pre-commit
  • prepare-commit-msg
  • commit-msg
  • post-commit
  • pre-rebase
  • post-checkout
  • post-merge
  • pre-push
  • pre-receive
  • update
  • post-receive
  • post-update
  • pre-auto-gc
  • post-rewrite

Common Issues

Credits

This module is heavily inspired by @nlf's precommit-hook

Contributors

Huge thanks to everyone listed here!

License

This software is licensed under the MIT license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].