git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Brewster <adambrewster@gmail.com>
To: "lists@mgreg.com" <lists@mgreg.com>
Cc: Daniel Barkalow <barkalow@iabervon.org>, git@vger.kernel.org
Subject: Re: Merging to and from non-current branches.
Date: Tue, 4 Aug 2009 23:33:27 -0400	[thread overview]
Message-ID: <c376da900908042033x312f2e8bx966359c514e0bc9d@mail.gmail.com> (raw)
In-Reply-To: <518952FC-626C-43FB-BD53-98DE849C9751@mgreg.com>

In case it helps, I think that if you're on branch dev, and you `merge
master`, you should get a commit that's substantially similar to that
that you'd get if you're on master and you `merge dev`.

The most noticeable difference should be that if you `checkout master
&& merge dev` the master is updated to point to the merged commit,
whereas if you `checkout dev && merge master` dev is updated to the
new commit.

(If there are conflicts, then the merge processes will differ more
significantly, but hopefully the human should be able to sort that
out.)

You should be able to use git-reset and git update-ref to clean up the
mess if that's not good enough.

Adam Brewster

On Tue, Aug 4, 2009 at 10:48 PM, lists@mgreg.com<lists@mgreg.com> wrote:
>
> On Aug 4, 2009, at 10:45 PM, Daniel Barkalow wrote:
>
>> On Tue, 4 Aug 2009, lists@mgreg.com wrote:
>>
>>> Hi All,
>>>
>>> I've been reading up on some of the GIT commands and I'm not sure if what
>>> I
>>> want/need exists.  Basically I want to merge all changes from one branch
>>> to
>>> another, regardless of whether I'm in either of those branches.  At the
>>> very
>>> least I would like to merge an existing "development" branch with the
>>> "master"
>>> branch without needing to first check out master.  I've seen rebase, but
>>> I'm
>>> not absolutely sure what that's doing.  Thoughts?
>>
>> It can't work, because you need to be able to use the working tree to
>> resolve any conflicts that arise during the merge. Merging without
>> checking out a branch is a bit like building without checking out a
>> branch; it would be avoiding using the filesystem for what it's there for.
>>
>>        -Daniel
>> *This .sig left intentionally blank*
>>
>
>
> Hi Daniel,
>
> I appreciate your post.  I understand what you're saying, and I'm not so
> much concerned about the logistics of what need to occur so much as a single
> command to intuitively handle it.  I've been doing a great deal of
> incremental development lately and it becomes rather tedious to have to
> checkout master, merge dev, re-checkout dev and proceed.  I'm not sure why
> this isn't currently possible with a single command.  I suppose I could
> write a shell script to do so, but that's a little less "native" than I'd
> like.
>
> Best,
>
> Michael
> --
> 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-08-05  3:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-04 23:21 Merging to and from non-current branches lists
2009-08-05  2:45 ` Daniel Barkalow
2009-08-05  2:48   ` lists
2009-08-05  3:33     ` Adam Brewster [this message]
2009-08-05  3:46     ` Sverre Rabbelier
2009-08-05 21:28     ` Alex Riesen
2009-08-06  1:48       ` lists
2009-08-06  2:15         ` Randal L. Schwartz
2009-08-06 17:41         ` Daniel Barkalow
2009-08-06 18:43           ` Junio C Hamano
2009-08-06 11:54     ` Steffen Siebert

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=c376da900908042033x312f2e8bx966359c514e0bc9d@mail.gmail.com \
    --to=adambrewster@gmail.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=lists@mgreg.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).