2014年12月16日 星期二

git push to non bare repository

$ git config --bool receive.denyCurrentBranch false

$ vi .git/hooks/post-receive
# Update working tree after receiving pushed branch
echo "*****************************************************"
echo "Post-receive hook: updating remote working directory"
echo "*****************************************************"
cd ..
env -i git reset --hard

$ chmod +x .git/hooks/post-receive




References :
Quick 'n' Dirty Git Deployment

沒有留言:

張貼留言