1

I try to copy the content of a Git Repo from my VPS Homedirectoy into my public_html Folder.

So i've createt a post-receive hook with:

GIT_WORK_TREE=/var/www/domainname/public_html git checkout -f

And i've set its permission with:

chmod +x post-receive

But nothing happens. So i've set the permissions of public_html to:

$ sudo usermod -a -G www-data myUser
$ sudo chmod -R g+w /var/www/domainname/public_html

Doesnt work either. I've already tried some of the solutions proposed here on stackoverflow regarding permissions without success. Any ideas ?

1 Answers1

0

But nothing happens.

You need to make sure the hook is actually executed (by adding, for instance, an echo "test") in it.

You also can touch a file (to see if it is created/updated), as in this answer.

Finally, just to be sure, I usually set GIT_DIR as well.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I used echo to test and changed the permissions on my public_html and it worked. not completly sure why... thx –  May 31 '14 at 20:44