Answer the question
In order to leave comments, you need to log in
Cannot run hooks/post-receive: No such file or directory?
I'm trying to set up a quick php deployment from a local PC to a remote server using git hooks from this article .
There it is proposed to add a post-receive file with the content
#!/bin/bash
TARGET="/home/webuser/deploy-folder"
GIT_DIR="/home/webuser/www.git"
BRANCH="master"
while read oldrev newrev ref
do
# only checking out the master (or whatever branch you would like to deploy)
if [ "$ref" = "refs/heads/$BRANCH" ];
then
echo "Ref $ref received. Deploying ${BRANCH} branch to production..."
git --work-tree=$TARGET --git-dir=$GIT_DIR checkout -f $BRANCH
else
echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch may be deployed on this server."
fi
done
chmod 777 post-receive
fatal: cannot run hooks/post-receive: No such file or directory
if [ "$ref" = "refs/heads/$BRANCH" ];
if [ "refs/heads/master" = "refs/heads/$BRANCH" ];
Answer the question
In order to leave comments, you need to log in
deleted the line
#!/bin/bash
and away we go.
so and to go or it is fraught?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question