* Fwd: how to apply patch?
[not found] <13f0168a1002061720t93ff6aew3420a41a547549d8@mail.gmail.com>
@ 2010-02-07 2:05 ` Matt Di Pasquale
2010-02-07 4:40 ` Tay Ray Chuan
0 siblings, 1 reply; 4+ messages in thread
From: Matt Di Pasquale @ 2010-02-07 2:05 UTC (permalink / raw)
To: git
I have a development version & a production version of my website.
There are a few essential differences between them that I want to
always stay different (like path constants, etc). When I make changes
on the dev version and test it out and they work and am ready to copy
them to the production (www) version, how do i do that without
annihilating the essential differences that i want to keep? I was
thinking of creating a patch or branch or something with the
differences. Then, copy dev to pro, then reapply/rebase the essential
differences to pro that got wiped out. if i rebase though, i want to
be able to rebase again on the next edit.
what's a good way to do this?
My dir structure:
example.com
www # production site
dev # development site
Via DreamHost control panel:
www.example.com points to example.com/www/
dev.example.com points to example.com/dev/
Why don't I just have a branch called dev? Maybe I should... Advice?
(Anyway, it's nice to be able quickly, simultaneously open
corresponding files from both www & dev in textmate.
I guess I could do that with like git show master:www/index.html |
mate or something, but then it opens in a new textmate window. it's
just not the same. I guess there's always the possibility of editing
www/index.html when I actually want to be editing dev/index.html, but
then again, it's also possible to be editing the wrong branch.)
My .git/config file has the following aliases for deployment:
# deploy dev
ddev = !rsync -avi --copy-unsafe-links --exclude='*.DS_Store'
--delay-updates --delete-after --delete-excluded -e ssh
~/Sites/example.com/dev/ acani@acani.com:Sites/example.com/dev/
# deploy www
dpro = !rsync -avi --copy-unsafe-links --exclude='*.DS_Store'
--delay-updates --delete-after --delete-excluded -e ssh
~/Sites/example.com/www/ username@example.com:Sites/example.com/www/
Thanks!
Matt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to apply patch?
2010-02-07 2:05 ` Fwd: how to apply patch? Matt Di Pasquale
@ 2010-02-07 4:40 ` Tay Ray Chuan
2010-02-07 6:06 ` Matt Di Pasquale
0 siblings, 1 reply; 4+ messages in thread
From: Tay Ray Chuan @ 2010-02-07 4:40 UTC (permalink / raw)
To: Matt Di Pasquale; +Cc: git
Hi,
On Sun, Feb 7, 2010 at 10:05 AM, Matt Di Pasquale
<liveloveprosper@gmail.com> wrote:
> [snip]
> Then, copy dev to pro, then reapply/rebase the essential
> differences to pro that got wiped out. if i rebase though, i want to
> be able to rebase again on the next edit.
> what's a good way to do this?
you could put this in your config:
[remote local]
url = .
fetch = dev
[branch "pro"]
remote = local
rebase = true
When you're wish to incorporate your latest changes in "dev" into
"pro(duction)",
$ git checkout pro #assuming you're not already on "pro"
$ git pull
Repeat ad nauseum.
--
Cheers,
Ray Chuan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to apply patch?
2010-02-07 4:40 ` Tay Ray Chuan
@ 2010-02-07 6:06 ` Matt Di Pasquale
2010-02-07 13:00 ` Tay Ray Chuan
0 siblings, 1 reply; 4+ messages in thread
From: Matt Di Pasquale @ 2010-02-07 6:06 UTC (permalink / raw)
To: Tay Ray Chuan; +Cc: git
Hi Ray,
Thanks for your response. I don't understand how that will transfer my
latest changes in ./dev into ./www while preserving the fundamental
differences between the 2 directories. Could you please provide some
explanation?
Also, is there an easy way to do something like this with a branch
instead of a remote? Remote doesn't make sense to me conceptually (and
I already have a remote repo setup that I push to from master). Maybe
I should have 2 different branches? One for dev & one for pro. How
would I do that?
Thanks,
-Matt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to apply patch?
2010-02-07 6:06 ` Matt Di Pasquale
@ 2010-02-07 13:00 ` Tay Ray Chuan
0 siblings, 0 replies; 4+ messages in thread
From: Tay Ray Chuan @ 2010-02-07 13:00 UTC (permalink / raw)
To: Matt Di Pasquale; +Cc: git
Hi,
On Sun, Feb 7, 2010 at 2:06 PM, Matt Di Pasquale
<liveloveprosper@gmail.com> wrote:
> [snip]
> Also, is there an easy way to do something like this with a branch
> instead of a remote? Remote doesn't make sense to me conceptually (and
> I already have a remote repo setup that I push to from master).
I'm already doing this with branches. It's true that I used a remote
configuration, but the remote configuration ("[remote local]") says
that we're treating the local repository as the remote repo ("url =
.") and to "fetch" the dev branch (into FETCH_HEAD).
(btw, instead of '[remote local]' it should be '[remote "local"]'.)
I do this so that you can just type "git pull" without specifying the
branch, unlike when using git-rebase.
> Maybe
> I should have 2 different branches? One for dev & one for pro. How
> would I do that?
You should.
Your history for the two branches would look like this:
a---b---c dev
\
A---B---C pro
(if you're reading this in a non-fixed width font, pro branches off at "c".)
The commits in uppercase (A, B, C) are those that are applied onto dev
- for example, changing file paths, configuration, etc.
Let's say you've made some changes onto your dev branch. To update
your production site, you would rebase your pro changes onto the dev
branch (using the config and commands in the previous message), so
that you get this history:
a---b---c---d---e dev
\
A'---B'---C' pro
(pro branches off at dev's tip, "e".)
You have to keep in mind several issues. For example, if you're
updating file paths, when new files are added in the dev branch, you
need to update the pro side to modify the file paths in those files. I
was also assuming your dev branch fast-forwards cleanly, or else the
rebase fumbles.
--
Cheers,
Ray Chuan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-07 13:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <13f0168a1002061720t93ff6aew3420a41a547549d8@mail.gmail.com>
2010-02-07 2:05 ` Fwd: how to apply patch? Matt Di Pasquale
2010-02-07 4:40 ` Tay Ray Chuan
2010-02-07 6:06 ` Matt Di Pasquale
2010-02-07 13:00 ` Tay Ray Chuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).