post-receive hook permission denied "unable to create file" error
- by ThomasReggi
Just got gitolite installed on my webserver and am trying to get a post-receive hook that can point the git dir in apache's direction.
This is what my post-receive hook looks like. Got this script from the Using Git to manage a web site.
#!/bin/sh
echo "post-receive example.com triggered"
GIT_WORK_TREE=/srv/sites/example.com/public git checkout -f
This is the error response i'm getting back from git push origin master from my local workstation. These are files from within my repository.
remote: post-receive example.com triggered
remote: error: unable to create file .htaccess (Permission denied)
remote: error: unable to create file .tm_sync.config (Permission denied)
remote: fatal: cannot create directory at 'application': Permission denied
Permissions of public.
drwxr-xr-x 5 root root 4096 Jun 26 17:23 public