-
ticket_number.sh - this script adds ticket number to commits in feature branch. It gets ticket number from branch name. Branch name should have following format
EXAMPLE-305/some_feature
.For example if first commit is named
Implements some feature
this script will update it with ticket number and it will look likeEXAMPLE-305 Implements some feature
.Also you can set
EACH_COMMIT
variable tofalse
if you want add ticket number only for the first commit.Symlink: ln -s ~/tools/git-hooks/src/prepare-commit-msg/ticket_number.sh .git/hooks/prepare-commit-msg
-
php_cs_fixer.sh - this script runs PHP-CS-Fixer before commit for fixing code style.
Symlink: ln -s ~/tools/git-hooks/src/pre-commit/php_cs_fixer.sh .git/hooks/pre-commit
-
phpunit.sh - this script runs PHPUnit before commit for running tests.
Symlink: ln -s ~/tools/git-hooks/src/pre-commit/phpunit.sh .git/hooks/pre-commit
-
check_working_on_master.sh - this script helps to warn if you make commit on the master branch.
Symlink: ln -s ~/tools/git-hooks/src/pre-commit/check_working_on_master.sh .git/hooks/pre-commit
-
composer_install.sh - this script installs composer packages specified in composer.json or composer.lock (if it presents) file after git pull or git merge.
Symlink: ln -s ~/tools/git-hooks/src/post-merge/composer_install.sh .git/hooks/post-merge
-
Pull this repo to some place in your machine
$ git clone https://github.com/greeflas/git-hooks.git
-
Create a symlink for needed script in your project
.git/hooks
directory$ ln -s ~/tools/git-hooks/src/prepare-commit-msg/ticket_number.sh .git/hooks/prepare-commit-msg
For information about contributing please read CONTRIBUTING.md.
This project is released under the terms of the BSD-3-Clause license.
Copyright (c) 2019 - 2024, Volodymyr Kupriienko