Skip to content

trungng92/git-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary

A list of commit hooks I've reused over and over that I've decided to source control.

How to install

To install them, you can use the handy-dandy install scripts that are in the repo. You can install hooks globally (with install-hooks-globally.sh), or per repo (with install-hooks.sh)

Examples

./install-hooks.sh hooks/prepare-commit-msg ~/my-git-repo
./install-hooks-globally.sh hooks/prepare-commit-msg ~/.my-global-git-hook-dir

Hooks

prepare-commit-msg

A hook that takes in a branch name and uses it to prefix commit messages:

# Using these two environment variables will make all of your commits on this branch start out with JIRA:ABC-1234

## optional prefix at the beginning of the commit message
export COMMIT_MSG_PREFIX='JIRA:'

## the actual expression from the branch name that we want to put in the commit message
export COMMIT_MSG_REGEX_EXPRESSION='ABC-[0-9]*'

About

Some git hooks that I've found to be useful

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages