In the remote server I have a post-receive hook set up in order to make a git checkout of my repository:
#!/bin/sh GIT_WORK_TREE=/var/www/ git
I think the problem may be with the ownership to the folder so set it to the current user ownership
sudo chown -R your_login_name /path/to/folder