Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] git: push from behind the firewall



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

Home Page Mailing List Linux and Japan TLUG Members Links