After editing my old question a few times, I make a new one because it is a new question now.
In .git/hooks/post-update I have:
echo \"a
The solution is to use post-receive as Alex pointed out. Also you need run unset GIT_DIR at the top of your script.
On the server I have created a second branch and switched to it:
$ git branch
master
* testing
My .git/hooks/post-receive now looks like this:
unset GIT_DIR
cd ..
git merge master
On the client I run git push.