when I do a git pull
on live server I'm logged in as root and so all modified or new files user and group are set to root:root
.
I've tried this set up in my post-update
hook file:
OWNER="example:example"
REPO_PATH="/home/example/public_html"
cd $REPO_PATH || exit
unset GIT_DIR
FILES="$(git diff-tree -r --name-only --no-commit-id)"
git merge FETCH_HEAD
for file in $FILES
do
chown $OWNER $file
done
exec git update-server-info
When I run a git pull
it just doesn't do anything.