All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wesley J. Landaker" <wjl@icecavern.net>
To: Matt Di Pasquale <pasquale@fas.harvard.edu>
Cc: git@vger.kernel.org
Subject: Re: git for pushing local subdir to website
Date: Mon, 3 Aug 2009 12:58:09 -0600	[thread overview]
Message-ID: <200908031258.13787.wjl@icecavern.net> (raw)
In-Reply-To: <13f0168a0908031109h10c02424l91938918639c6a57@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2945 bytes --]

On Monday 03 August 2009 12:09:26 Matt Di Pasquale wrote:
> yes... i've thought of that. that's a good idea. i just love git and
> i've never really used rsync. how do i do that?
> i'll go google it..

Rsync can do a lot of things, but the usual easy way to do it is to do 
something like this to send files via rsync over an ssh connection:

rsync -av /some_dir/ user@host:/some_dir/

This is essentially the same as using scp, but rsync saves a lot of network 
bandwidth by only sending the changes between the source and destination.

> i guess it would also be nice to use git though incase i decide i want
> a collaborator, right?

Setting things up to have a collaboration is kind of orthogonal to 
installing a production version of your app, but you could use the same 
server (and possibly the same git repository) for both things if you wanted 
to.

Here an example of one way to do it:

On the server you could have a normal git repository in, say, 
/home/me/myapp, and it always has the "production" branch checked out. So 
now the following directories are interesting:

/home/me/myapp              -- repository branch w/ "production" checked out
/home/me/myapp/.git         -- the actual bare git repository
/home/me/myapp/example.com/ -- the files that the web server should see

Now, you can use symlinks (or web-server configuration) to point the 
webserver to the right locations, for example:

http://example.com/myapp/     -- link to /home/me/myapp/example.com/
http://example.com/myapp.git/ -- link to /home/me/myapp/.git/

Now, collaborators can pull from the http://example.com/myapp.git and get 
the whole project, but access to http://example.com/myapp/ sees the 
example.com subdir as it's root, and everything works normally (assuming 
webserver configuration & permissions are correct).

Now you work on whatever branches you want, and push to the server whenever 
you want for collaboration using whatever branches you want. As far as the 
webserver is concerned, nothing changes when you do a push.

Then, when you are ready to change the website, you put your production 
changes on the "production" branch, push them, and make sure they are 
checked out on the server (git push doesn't automatically check out the 
files), e.g.:

client$ # just made changes in production branch and want them "live"
client$ git push

server$ cd /home/me/myapp
server$ git reset --hard

> how would u set it up?

Personally, I might set something like this if I had a good reason, but 
otherwise, I'd host my git repository for collaboration separately, and just 
use rsync to install production files on the server. For one thing, that 
needs less prerequisites and setup on the server, so it's good if you don't 
fully control the server.

Either way, a "production" branch is a good idea so you know logically 
exactly what and when you released things live.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-08-03 18:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-03 17:11 git for pushing local subdir to website Matt Di Pasquale
2009-08-03 18:01 ` Wesley J. Landaker
2009-08-03 18:09   ` Matt Di Pasquale
2009-08-03 18:58     ` Wesley J. Landaker [this message]
2009-08-03 19:13       ` Matt Di Pasquale
2009-08-03 21:48         ` Wesley J. Landaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200908031258.13787.wjl@icecavern.net \
    --to=wjl@icecavern.net \
    --cc=git@vger.kernel.org \
    --cc=pasquale@fas.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.