git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Allen Johnson <akjohnson78@gmail.com>
To: thepurpleblob <howardsmiller@googlemail.com>
Cc: git@vger.kernel.org
Subject: Re: merge confusion
Date: Fri, 31 Jul 2009 09:32:50 -0400	[thread overview]
Message-ID: <6786ed4f0907310632t2435f7d9y9151febea7844ca@mail.gmail.com> (raw)
In-Reply-To: <24755682.post@talk.nabble.com>

I think in this case you should do a `git fetch` instead. Doing a pull
is the same as performing a fetch and merge.

With a `fetch`, your remote branch is up-to-date while your tracking
branch is left untouched. You can later check the differences between
the two branches and merge when you're ready.

$ git fetch # update remote branch heads
$ git diff origin/branchname # show what is different between your
local branch and the remote
$ git merge origin/branchname # only when you're ready

For me, it's easier to keep my personal branches separate by using a
topic branch that doesn't track a remote branch. Then, optionally,
merge in differences from whatever remote tracking branches as needed.

$ git branch -t development origin/development # tracking remote
development branch
$ git checkout -b mystuff development # my personal stuff

Now a `git pull` won't affect `mystuff`.

Allen

On Fri, Jul 31, 2009 at 8:35 AM,
thepurpleblob<howardsmiller@googlemail.com> wrote:
>
> 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!
> --
> View this message in context: http://www.nabble.com/merge-confusion-tp24755682p24755682.html
> Sent from the git mailing list archive at Nabble.com.
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

  reply	other threads:[~2009-07-31 13:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-31 12:35 merge confusion thepurpleblob
2009-07-31 13:32 ` Allen Johnson [this message]
2009-07-31 16:29 ` Sean Estabrooks
2009-10-28 12:01 ` Tim Mazid
2009-10-28 15:43   ` Alex Riesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6786ed4f0907310632t2435f7d9y9151febea7844ca@mail.gmail.com \
    --to=akjohnson78@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=howardsmiller@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).