Can I create with git files owned by root without using root to push?
I use git user to push on the webserver. But /var/www is owned by root or www-data with no write access for other user.
I can pull in an other directory and use “hook/post-receive” but still this hook is executed with the git user…
For the moment I log in the webserver and do a sudo git pull origin. But it will be more efficient if I was hable to do a git pull server from my laptop.
Thanks
My solution was to give all files to git by way of the
www-pubgroup with read permission for everyone—except settings files with the MySQL password.I push to
/home/git/repository/projectand checkout to/var/www/projectusinghook/post-receive.