This gist allows full control from the client, discarding all possible changes made in the server!
NOT USEFULL for colaborative work without further modifications. Coworkers commits could be deleted.
Init server repository and configure
mkdir <path>
cd <path>
git init
Add to .git/config
[receive]
denyCurrentBranch
Create hook post-receive
#!/bin/sh
GIT_WORK_TREE=<path> git checkout -f
Add remote on client
git remote add <name> <user>@<server>:<path>
git push --set-upstream <name> <branch>