ssh user@webspace.host
cd myapp/production
mkdir .git
cd .git
git init --bare
.git/hooks
with this content:#!/bin/sh
TARGET="/kunden/homepages/xx/xxx/htdocs/myapp/production/app"
REPO="/kunden/homepages/xx/xxx/htdocs/myapp/production/.git"
git --work-tree=$TARGET --git-dir=$REPO checkout -f
Update: It's important that your "post-receive" file has the permission to execute. In my case, I gave the file permission 705.
git init
git remote add deploy ssh://user@webspace.host/kunden/homepages/xx/xxx/htdocs/myapp/production/.git
git push deploy HEAD