Just like an additional answer, here is a function that you can use to initialize a git repository that automatically makes executable traps; You must put it in .bashrc
or in the file that you use when starting the terminal. The story is below :)
ginit () { git init gitpath='git rev-parse --show-superproject-working-tree --show-toplevel | head -1' chmod u+x "$gitpath"/.git/hooks/* for submodule in "$gitpath"/.git/modules/*; do chmod u+x "$submodule"/hooks/* done }
I was annoyed by the same as you. I donβt want to remember that I have to do all the trap executable files every time I initialize the repository. In addition, when you use submodules, their hooks are not in .git/hooks
, but in .git/modules/NameOfSubmodule/hooks
, and they must also be executable.
Jakub wagner
source share