I have two non-bare git repositories, one a local machine in which I develop and the second on a server, on which I build. In the local repository I have a post-commit hook with "git push -f server". Each time I commit on a local machine, changes are pushed to the server. Unfortunately, on the remote git stages a "revert" of my changes. I have to do a "git reset HEAD --hard" on the server manually, which is quite annoying. How can I tell git to accept changes without staging a revert or how can I automatically do a reset on the server? I have tried to add a post-receive hook on the server, but it doesn't work.
I have found a similar question How do I push to the current git branch on remote, and have changes reflected immediately? , but it did not help (