Following the instructions in A web-focused Git workflow I set up a prime and hub repository on my web server and then cloned the hub to my machine at home.
I started testing commits and pushes with changed files in documentroot and the changes would appear fine on the root of the webserver. However, when I tried to push a file in a subdirectory, I rec'd the following message:
remote:
remote: **** Pulling changes into Prime [Hub's post-update hook]
remote:
remote: From /home/git/site_hub
remote: * branch master -> FETCH_HEAD
remote: error: unable to create file academy/testthegit2.html (Permission denied)
Again, no permission issues in the web root, but put a file in a subdir and an error is tossed.
The git user is in the apache group and the sub-directories are chmod 755.
Here is the hub's post-update:
#!/bin/sh
echo
echo "**** Pulling changes into Prime [Hub's post-update hook]"
echo
cd /usr/local/apache/htdocs || exit
unset GIT_DIR
git pull hub master
exec git-update-server-info
and the prime (document root's) post-update:
#!/bin/sh
echo
echo "**** pushing changes to Hub [Prime's post-commit hook]"
echo
git push hub
To reiterate, works in root, fails in subdir.
Thanks for any advice.