Many hosting service now supports not only FTP and web uploading but also SSH. It's more convenient to use the Git flow:
- Modify and test your site locally.
- Push to remote Git repo, which triggers the update of your website.
My settings:
- Suppose the HTTP server use
${HOME}/htmlas the root dir of your website. git initthe${HOME}/htmlas a Git repo with working dir.git init --barethe${HOME}/html.gitas a bare repo for push/pull.- Edit
${HOME}/html.git/hooks/post-updateas follows.
rsynccan come handy in cases where your HTML root is a subfolder of Git and the hosting server does not support soft linking well.In my use case,
SRC/is the subdir in the Git repo.DSTis the dir that the hosting server use for HTTP document root.