I can't do use git post-update hook to pull into my website folder, from the repo. I have two users, user1 and user2, who both belong to group admin_group (I verify
id user1
uid=1001(user1) gid=1003(admin_group) groups=1003(admin_group),1001(user1)
Same for user2. I looked up this and performed these commands as my root:
cd repository.git
sudo chmod -R g+ws *
sudo chgrp -R admin_group *
git repo-config core.sharedRepository true
This above step was probably unnecessary, since I can push just fine. I also did:
cd websitedir
sudo chmod -R g+ws *
sudo chgrp -R admin_group *
However, my post-update hook still won't pull the files to the websitedir
automatically.
// post-update
cd /var/www
env -i git pull
It must be running as a different user, but I don't know which one. How do I give the user running the post-update hook permission?