Git - remote: erro: não é possível executar hooks / post-receive: nenhum arquivo ou diretório

Eu recebo o erro:

remote: error: cannot run hooks/post-receive: No such file or directory

Ao tentar empurrar para o controle remoto. O arquivo pós-recebimento existe no local correto (testnew.git / hooks) e contém:

#!/bin/bash2
export GIT_DIR=/var/www/testnew/testnew/.git/
export GIT_WORK_TREE=/var/www/testnew/testnew/
cd /var/www/testnew/testnew/

echo "here we go..."
git fetch
git merge origin/master
git submodule update --init --recursive

Eu tentei definir permissões para pós-recebimento usando:

chmod a+x post-receive

Mas isso dá o mesmo erro. Definir permissão para 755 remove o erro, mas o script não é executado.

questionAnswers(3)

yourAnswerToTheQuestion