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}/html
as the root dir of your website. git init
the${HOME}/html
as a Git repo with working dir.git init --bare
the${HOME}/html.git
as a bare repo for push/pull.- Edit
${HOME}/html.git/hooks/post-update
as follows.