I was advised to set up on a remote server
foo.com/~/bar.com # live webpage content
foo.com/~/bar.com.git # a bare repo
so, from my
I use the following post-update
script (make sure you set executable bit on it):
#!/bin/sh
rm -rf ~/public_html/xxx
git-archive --format=tar --prefix=xxx master | tar x -C ~/public_html
It does the thing, but there's a short window when the site is not available. Doing git pull
directly in yours ~/bar.com
will expose git's .git
directory, so make sure you either block it in your http server, or keep .git
somewhere higher in directory hierarchy, ie. something like:
~
\
- repo
\
- .git
- bar.com
\
- your content