Why does my Git hooks shell script result in a parse error?

I do little shell scripting so hopefully I am doing something obviously wrong! This hook is intended to run whenever you push. If you are on the designated branch, in this case ‘githook’, it should run npm run testbuild and if that fails, stop the push. If you are on another branch it should not… Read More Why does my Git hooks shell script result in a parse error?

Having trouble accessing the arguments to the git pre-receive hook

I am running vanilla git (git version 2.23.3) as origin master of a bare repository on an AWS instance. I have created a file repo_dir/hooks/pre-receive with the following contents: #!/bin/bash -p echo $1 > pre-receive-old-hash.txt echo $2 > pre-receive-new-hash.txt echo $3 > pre-receive-ref.txt exit 1 I make a test push from my remote. I can… Read More Having trouble accessing the arguments to the git pre-receive hook