git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: merge confusion

From
TMTim Mazid <timmazid@hotmail.com>
Date
Oct 28, 2009, 12:01 UTC
Message-ID
<26093419.post@talk.nabble.com>
In-Reply-To
<24755682.post@talk.nabble.com>
thepurpleblob wrote:
Show 21 quoted lines
> 
> 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...
> 
> * clone a remote repo
> * created a local branch to track one of the remote branches
> * did work on the local branch and then created another 'feature' branch
> from that
> * time elapsed and at some point(s) I pulled from the remote but did not
> merge the original local branch
> * finished feature, checkout local branch and merge in feature. 
> 
> 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.
> 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?
> 
> Thanks!
> 

Did you 'git pull' or 'git fetch'? 'git pull' automatically merges, where 'git fetch' only gets the data. You can just do a 'git branch branch-to-merge COMMIT' then 'git merge branch-to-merge' from your feature branch. Alternatively, you could just do a straight 'git merge COMMIT' from your feature branch. Though I'm not sure of the consequences of merging a commit instead of a branch.

Good luck, Tim.

-- 
View this message in context: http://www.nabble.com/merge-confusion-tp24755682p26093419.html
Sent from the git mailing list archive at Nabble.com.
Previous: Sean EstabrooksNext: Alex Riesen
Message 4 of 5 in “merge confusion”
  1. thepurpleblobJul 31, 2009
  2. Allen JohnsonJul 31, 2009
  3. Sean EstabrooksJul 31, 2009
  4. Tim MazidOct 28, 2009
  5. Alex RiesenOct 28, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.