Hooks
git hooks
pre-push example
-
create the file
~/.githooks/pre-pushwhile true; do read -r -p "Have you executed 'composer test' already? (y|n): " yn < /dev/tty case $yn in [Yy]*) exit 0 ;; [Nn]*) echo "\e[31mPlease execute the command first \e[39m"; exit 1; ;; *) echo "Please answer [y]es or [n]o." ;; esac done -
execute
git config --global core.hooksPath ~/.githooksto use this hook at every repository