Git does not recognize repositories while executing a hook

Viewed 76

In my post-receive hooks I want to run this simple hook which is actually just two lines if you take out the echos and what not.

I verified the commands are correct by ssh(ing) into the server and double checking the paths.

However I get this error:

remote: fatal: Not a git repository: '.'

What does the '.' mean and why does it not work. If I type these command in manually while on the server they work fine.

But in the hook they do not.

post-receive hook

#!/bin/sh

echo "****"
echo "*****"
echo "start:post-receive"
echo "*****"
echo "****"

cd /home/user_name/public_html
git pull /home/user_name/root.git master

echo "****"
echo "*****"
echo "end:post-receive"
echo "*****"
echo "****" 
1 Answers
Related