Re: merge result
- From
- Lynn Lin <lynn.xin.lin@gmail.com>
- Date
- Sep 10, 2011, 01:11 UTC
- Message-ID
- <CAPgpnMTMPQQPkS-gKLvUJNKLfMWuAT-oA3NCiSRFxu7PknYsnA@mail.gmail.com>
- In-Reply-To
- <vpqmxed6fby.fsf@bauges.imag.fr>
On Fri, Sep 9, 2011 at 9:00 PM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 30 quoted lines
> Lynn Lin <lynn.xin.lin@gmail.com> writes: > >> Hi All, >> When I merge branch A back to master branch,if there are same >> commit(developer do double commit) both in master and A branch, there >> will be two same commit in master branch. > > They cannot be the "same" commit. They are different commits (i.e. > different sha1 identifier, and probably different trees), even though > they may have the same commit message and represent the same diff. > >> 1->2->3-4>5 Master >> | >> 4->6->7 A > > A more accurate drawing would be > > 1->2->3-4>5 Master > | > 4'->6->7 A > > and after merging, you'd get > > 1->2->3-4>5-->8 A, master > | / > 4'->6->7 > > with 8 having both 4 and 4' as ancestors. There's nothing wrong with it. > Git cannot remove either 4 or 4' without rewritting history, and "git > merge" does not rewrite history.
so confused here.If 4' is just next 4 commit,how can the diff work? for example
1->2->4->4'->6->...
diff 4 and 4' is a little confused,correct?
Thanks for your time to explain here and teach me
Show 8 quoted lines
> If you really really want to avoid this duplication in the history, then > learn about rebase (which is both powerfull and dangerous, you've been > warned). > > -- > Matthieu Moy > http://www-verimag.imag.fr/~moy/ >