Re: merge confusion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 31 Jul 2009 06:41:32 -0700 (PDT)
thepurpleblob <howardsmiller@xxxxxxxxxxxxxx> wrote:

Howard,

> I had some unexpected behaviour doing a merge today. I wonder if anybody can
> tell me where I have gone wrong. This is the sequence...
[...]

Not sure i'm following your question, will take a crack at it though.
I believe this is what you did:

 1. cloned a remote repo
 2. created a local branch B and committed some changes onto it
 3. created another local branch F
 4. committed some changes on F
 5. pulled in additional changes from a remote repo into F
 6. committed additional local changes on F
 7. merged F into B

> What I didn't expect is that all the subsequent changes on the tracked
> remote branch got merged in too. Which I didn't want.

When you merged the feature branch(F) you merged all the new commits made on
it.  By design this includes any commits you pulled in from any remote; you
don't just get the subset of commits that you made locally.

> So the question is - is that what's supposed to happen (ie. if you do any
> merge the tracked branch 'fast forwards' the remote) and, if so, if I want a
> branch that stays a branch (doesn't ever merge with the remote) how would I
> do that?

There's nothing forcing you to merge with a remote, you just need to find a
workflow that accomplishes what you want.  As far as i can tell without knowing
the actual commands you used, it appears you explicitly asked Git to merge in
changes from the remote when you merged the feature branch.

So to hopefully answer your question, don't merge remote changes into your
feature branch if you want your feature branch to only contain local changes
when you merge it with other local branches.

HTH,
Sean
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]