On Mon, Feb 4, 2013 at 10:35 PM, Derek Gaston <fried...@gmail.com> wrote:
> Now you quickly rerun your testing for B1 and C1 (just like with SVN) and
> verify that everything is still good and then you push:
>
Let me expand a bit on this (for those of you unfamiliar with how rebase
works). I'm going to use a $ for prompts to make things clearer
During a rebase, if there is a collision (that can't be cleanly merged, git
is pretty good at auto-merging collisions) the rebase will stop and ask you
to fix up the current patch. Returning to what we were doing earlier we
started with:
upstream/master: A, D
roys_feature: A, B, C
And then did:
$ git pull --rebase upstream master
Let's go through _exactly_ what that rebase command is doing:
1. "Unwind" your new patches (B and C) from your branch (roys_feature) so
that you now have:
roys_feature: A
2. Add in upstream patches:
roys_feature: A, D
3. Start applying your patches one by one:
roys_feature: A, D, B
4. If there is a collision at this point the rebase will stop. You have
multiple choices at this point:
4a. If want to abort the rebase altogether just do:
$ git rebase --abort
That will give you back:
roys_feature: A, B, C
Always remember, everything is undoable in Git.
4b. If you want to proceed with the rebase you need to fix the collisions
(ie, fixup the B patch so that it applies cleanly on top of D). The first
place to start is:
$ git stat
This will tell you what files are ok (if you have coloring turned on they
will be green) and which files need some help (they will be red and will
say "modified in both"). Go open those files with your editor and find the
merge bits (<<<<< and >>>> like with any manual merge) and fix up those
files.
Now, at this point you can recompile and retest B! Yep, right in the
middle of rebase! If everything looks good you have to tell Git that
what's now in those files with collisions is good by:
$ git add src/file_with_collisions.C
Do that for each file that you fixed a collision in. After everything is
"green" (seriously, turn coloring on) you can do:
$ git rebase --continue
This will actually commit "B1" (a modified form of B that applies cleanly
on D).
5. Now Git will move to your next patch, C. Let's say C applies cleanly.
Then the rebasing is done and you're left with:
roys_feature: A, D, B1, C
You can recompile and retest at this point if you want and then push to
master:
$ git push upstream HEAD:master
The commands may seem odd at first... but it's really powerful and actually
maps pretty well to how we've been working for years with "svn up".... but
a lot more powerful!
Derek
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel