Let's say you have a remote user www, your server is domain.com and your app is myapp:
[email protected]:~$ mkdir myapp repo/myapp.git
[email protected]:~$ cd repo/myapp.git
[email protected]:/home/www/repo/myapp.git$ git init --bare
[email protected]:/home/www/repo/myapp.git$ touch hooks/post-receive
[email protected]:/home/www/repo/myapp.git$ chmod +x hooks/post-receive