Introducing Git to your FTP workflow covers some basic Git concepts and then shows couple of schemes to use git for publishing web content. Not much words, so I will try to write some blog post to complement it.
7. + History
+ Undo
+ Sharing Code
+ Backup
– Collaboration
– Not great sync
– FTP is still used
cd /your/code/dir/
git init
git commit -am "First commit"
8.
9.
10. + History
+ Undo
+ Collaboration
+ Test / Stage / Prod
– Installation of python plugin
– Setting it up is a bit complicated
– What if someone changes web files
– FTP credentials in git config files
https://github.com/ezyang/git-ftp
git clone --bare https://github.com/name/repo.git
11.
12. + History
+ Undo
+ Collaboration
– What if someone changes web files
git clone --bare https://github.com/name/repo.git
# post-receive
deploy_to_dir = File.expand_path('../work')
`GIT_WORK_TREE="#{deploy_to_dir}" git checkout -f master`
http://krisjordan.com/essays/setting-up-push-to-deploy-with-git