
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tlug] git: push from behind the firewall
- Date: Mon, 11 Jul 2011 15:02:28 +0900
- From: Darren Cook <darren@example.com>
- Subject: [tlug] git: push from behind the firewall
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10
Another git question, that has me wondering if I'm trying to use it
wrongly, or missing out on some clever command that only the gurus know
about. [1]
For context, I'm thinking about a development website, behind a
firewall, and a live website. What I want to be able to do, on my
development machine, is type:
git push live.example.com:~/www/
And it would create the repository on live.example.com just as if I'd
done git clone from there.
Thinking it through, I don't even want the .git directory on the live
server (no edits will be done there). So, how about:
# The git equivalent of "svn export"
git checkout-index -a --prefix="tmp/"
# Copy the files
rsync -avz --delete tmp/ live.example.com:~/www/
# Tidyup
rm -rf tmp/
Getting more sophisticated, I don't want documentation, examples, etc.
uploaded, and also don't want the live server error logs and data
deleted, so this may be better:
git checkout-index -a --prefix="tmp/"
rsync -avz --delete tmp/{lib,myapp} live.example.com:~/www/
rm -rf tmp/
Now, only the two specified directories are kept in sync but, for
instance, ~/www/logs/ is not touched.
Thoughts, comments, advice all welcomed,
Darren
[1]: I started this email thinking I needed some clever ssh pipe
solution to allow me to do something like "git clone 127.0.0.1" from the
live server. Or, give up, and set up a central repository on a public
IP. But after a bit more research, and thinking about the actual goal, I
rather like the rsync solution I ended up with.
--
Darren Cook, Software Researcher/Developer
http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)
Home |
Main Index |
Thread Index