I wrote a file named post-commit (no file extension, executable, owned by the git user) with a standard bash script to trigger a Jenkins build on another server and placed it in directory git/ProjectName/hooks in our remote repository. When I manually execute the file as user git (./post-commit).
The Jenkins build starts. But when I push something to the repository (and I see a commit has been made in the Git log of the remote repository) the post-commit file is not executed (I check by placing an echo command in the file).
Why post-commit file does not execute?
echocommand to eradicate the possibility that your script contains a bug somewhere else.