Re: Merging to and from non-current branches.

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

 



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@xxxxxxxxx<lists@xxxxxxxxx> wrote:
>
> On Aug 4, 2009, at 10:45 PM, Daniel Barkalow wrote:
>
>> On Tue, 4 Aug 2009, lists@xxxxxxxxx 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@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
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]