I have set up a live repo on my server with:
/cd/siteusername/public_html/
mkdir site.git
cd site.git
git init —bare
cd hooks
cat > post-receive
#!/bin/sh
git --work-tree=/var/www/domain.com --git-dir=/var/repo/site.git checkout -f
chmod +x post-receive
The issue is everytime i push changes from my local repo using:
git add .
git commit -m "file change"
git push live master
git changes the ownership of all the files in my live repo so i get presented with a 500 error
How can i prevent this happening?