The user and group are always changed to root:root if I execute git pull or git checkout
So I created the file .git/hooks/post-merge with the following content:
#!/bin/sh
chown -R mycompany:www /srv/www/vhosts/mycompany
exec git-update-server-info
The file has execute permission
But it does not work, nothing changes after git pull was called.