git-push branch to bare repository
#!/bin/bash
# read the passed in args
read oldrev newrev ref
# find the branchname http://stackoverflow.com/a/13198980
branchname=${ref#refs/heads/}
# checkout the branch
git --work-tree=/path/to/code --git-dir=/path/to/bare.git checkout -f ${branchname}