I am using another approach for deployment of my files over ssh/ftp: instead of using a git push, I pack the wanted files as a .tar.gz
archive and upload that using scp
or the corresponding ftp commands. See
the section "The Hook" in my blog entry. There, I find all wanted files using find
and pack them using tar:
find . -name "*.html" -o -name "*.css" -o -name "*.js" | tar -czf archive.tgz --files-from -
After doing that, you can simply upload the file using scp
and unpack with a command over ssh
:
scp archive.tgz mamuelle@g<domain>:~/.public_html/
ssh mamuelle@<domain> tar xfz .public_html/archive.tgz -C .public_html
You can do the same thing using ftp. Check out the corresponding manual on how to upload files to ftp.
What I described above can be started automatically using hooks. I use it with post-merge
, for example.
Another option is described in this answer. There are simple shell scripts to upload a file via git-push
.
edit With ssh, you can also directly push to a bare remote repository.