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 15:48:40 -0600 [thread overview]
Message-ID: <200908031548.45112.wjl@icecavern.net> (raw)
In-Reply-To: <13f0168a0908031213r59a9ea61m824ca7e5209962fc@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2270 bytes --]
On Monday 03 August 2009 13:13:43 Matt Di Pasquale wrote:
> wow. thanks. that gave me some good ideas.
> i think u were right about rsync. it was pretty easy to set up.
> assuming the name of my app is myapp, i just put the following alias
> in my ~/.bash_profile on my local machine.
>
> alias mapush='rsync -e ssh -av --exclude=".DS_Store"
> ~/Projects/myapp/myapp.com/
> matt@mattdipasquale.com:projects/myapp.com/'
Okay, looks like you've got rsync figured out!
> btw, is there a way to make aliases that are local to certain
> directories? like typing mapush works from any directory. what if i
> just wanted the alias to be push and only work from within
> ~/Projects/myapp? is that possible?
The typical way to do this is to make a "bin" or "scripts" subdirectory of
your project, then make a shell script and call it via ./bin/push or
./scripts/push or whatever. You can also do pretty much anything by using
shell functions instead of aliases. They work just like shell aliases but
are defined differently (man bash, then search for FUNCTIONS).
Since the topic is git, I should also mention that you can also set up
repository hooks that make things happen when triggered, e.g. automatically
rsync to the server when you commit to "production" for example. Do a man
githooks for more info on that.
> it's pretty fast. but will rsync be okay if i decide to move files
> around a bit? i know git is pretty good about that. and what if i
> delete certain files? will rsync delete them... like git does? guess
> i'll figure those questions out in time.
Rsync will not delete anything unless you add "--delete". If you use that,
you probably also want "--delete-after" for a website, which makes sure that
deletes are only done after everything else is copied over. The default is
the same as "--delete-before", which does deletes before copying things
(e.g. to save disk space).
As far as raw network transfer performance, git and rsync are probably
pretty comparible, as they both are passing just changes instead of complete
files around. Obviously they work very differently internally so e.g. I
imagine that git will perform much better in some cases because it tracks
content instead of files.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
prev parent reply other threads:[~2009-08-03 21:49 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
2009-08-03 19:13 ` Matt Di Pasquale
2009-08-03 21:48 ` Wesley J. Landaker [this message]
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=200908031548.45112.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.