Various useful git hooks and related scripts
Currently only one hook with two checks in presented:
- If issue reference is presented in commit message
- If issue reference presented in commit message matches current branch (it is assumed that work is done in issue branches only as it is very often)
$ touch foo
$ git add foo
$ git commit -m 'foo'
ERROR: Missing issue reference in commit message
$ git commit -m 'A-1 foo'
ERROR: Issue reference in commit message does not match current branch "SDET-2691"
$ git commit -m 'SDET-2691 foo'
[SDET-2691 a97be5a] SDET-2691 foo
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 foo
- Create file with destination directories with name like
target-directoriesand content like (replace with your paths):
/home/user/work/project1/.git/hooks/
/home/user/work/project2/.git/hooks/
- Run
install.shscript from repository directory:
$ ./install.sh target-directories
