I used this guide to use git to autopublish my changes on my website when I push to my remote origin git repository:
http://www.lwp.ca/james/2010/03/using-git-to-manage-online-website-projects/
Here's my /hooks/post-update file:
cd ../../public_html/dir/wbg
env -i git pull
Here's my directory structure:
/home/git/wbg.git <-- my remote git repository
/home/public_html/dir/wbg <-- my web folder
When I run
git push origin master
The repository updates but my web folder is still empty. Any ideas?
Edit: if any future traffic sees this, my real problem was that BOTH your remote origin AND your destination website directory must be git repositories. You can't just set it up to copy your project to a new folder unless that folder is also a git repo.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…