Re: git merge and cherry-pick and duplicated commits?
- From
- skillzero@gmail.com <skillzero@gmail.com>
- Date
- Jan 14, 2009, 18:33 UTC
- Message-ID
- <2729632a0901141033p47b4d8dah46f5bac27307d306@mail.gmail.com>
- In-Reply-To
- <496DA3B2.1070807@viscovery.net>
On Wed, Jan 14, 2009 at 12:34 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 34 quoted lines
> After you created the fixup, you have this situation: > > o--o--o <- A (feature branch) > / > --o--x <- X (the fix-up branch) > \ > o--o--o <- Z (probably your master) > > You merge the fix-up into the feature branch and continue developing the > feature: > > o--o--o--M--o--o <- A > / / > --o--x-----' <- X > \ > o--o--o <- Z > > Other people need the fix in Z right now, so you merge it into Z as well: > > o--o--o--M--o--o <- A > / / > --o--x-----< <- X > \ \ > o--o--o--N <- Z > > You complete your feature and merge it into Z: > > o--o--o--M--o--o <- A > / / \ > --o--x-----< \ <- X > \ \ \ > o--o--o--N---------O <- Z > > The fix-up commit is only once in your history.
Thanks for the info. That's what I was hoping, but I was thinking that I'd get duplicate commits if I did that. I'll have to try it out when I run into this situation again.
Related to this, is there a way to easily find the common merge base given a bunch of a branches? When I want to fix a bug, I want to say "Given branches A, B, C, D, and E, where should I fork my bug fix branch from so that I can merge this branch into all those branches without getting duplicate commits?".