git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tay Ray Chuan <rctay89@gmail.com>
To: Matt Di Pasquale <liveloveprosper@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: how to apply patch?
Date: Sun, 7 Feb 2010 21:00:29 +0800	[thread overview]
Message-ID: <be6fef0d1002070500p4850b847p21a0736447100050@mail.gmail.com> (raw)
In-Reply-To: <13f0168a1002062206p8da7dd0n5f1b353c33b344f3@mail.gmail.com>

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

      reply	other threads:[~2010-02-07 13:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 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=be6fef0d1002070500p4850b847p21a0736447100050@mail.gmail.com \
    --to=rctay89@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=liveloveprosper@gmail.com \
    /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 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).