* How to pull a single changeset from a child branch into a parent branch?
@ 2006-02-10 4:03 Ben Greear
2006-02-10 5:01 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Ben Greear @ 2006-02-10 4:03 UTC (permalink / raw)
To: git
I have a linux-2.6 repo with two branches off of 2.6.13.
One branch (ben_v13) has just my own changes.
A second branch (work_v13) has the 2.6.13.5 patch, and I've also pulled
ben_v13 into it.
Now, I made a small change to work_v13, and I'd like to pull only
that changeset into ben_v13. Is there a way to do that w/out
having to export and apply a patch?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to pull a single changeset from a child branch into a parent branch?
2006-02-10 4:03 How to pull a single changeset from a child branch into a parent branch? Ben Greear
@ 2006-02-10 5:01 ` Junio C Hamano
2006-02-10 21:16 ` Ben Greear
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2006-02-10 5:01 UTC (permalink / raw)
To: Ben Greear; +Cc: git
Ben Greear <greearb@candelatech.com> writes:
> I have a linux-2.6 repo with two branches off of 2.6.13.
>
> One branch (ben_v13) has just my own changes.
> A second branch (work_v13) has the 2.6.13.5 patch, and I've also pulled
> ben_v13 into it.
"2.6.13.5"
o---o---o---o
/ \ "work_v13"
---o "2.6.13" .---*
\ /
o---o---o
"ben_v13"
'o' are commits, '*' is a merge.
> Now, I made a small change to work_v13,
"2.6.13.5"
o---o---o---o
/ \ "work_v13"
---o "2.6.13" .---*---x
\ / (new change)
o---o---o
"ben_v13"
> ... and I'd like to pull only
> that changeset into ben_v13. Is there a way to do that w/out
> having to export and apply a patch?
I would have done things differently.
It is generally a good idea if a change is applicable to more
than one branches, and these branches have merge relationship
between them (work_v13 merges from ben_v13, which has already
happened), then to apply that change to the oldest branch and
pull the branch to the new one. In other words, if you made the
change to 2.6.13 based one, you could have pulled that into
2.6.13.5 based one.
"2.6.13.5"
o---o---o---o
/ \ "work_v13"
---o "2.6.13" .---*
\ /
o---o---o---x
"ben_v13"
(new change)
[Commit what is applicable to both in older branch]
"2.6.13.5"
o---o---o---o
/ \ "work_v13"
---o "2.6.13" .---*--*
\ / /
o---o---o---x---'
"ben_v13"
(new change)
[And then merge that to the derived one]
Assuming that correcting the situation like this is not an
option, you could check "git cherry-pick". It lets you create
something like this:
"2.6.13.5"
o---o---o---o
/ \ "work_v13"
---o "2.6.13" .---*---x
\ /
o---o---o---------x'
"ben_v13" (equivalent of 'x' commit)
The command sequence to do this is:
$ git checkout ben_v13
$ git cherry-pick work_v13
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to pull a single changeset from a child branch into a parent branch?
2006-02-10 5:01 ` Junio C Hamano
@ 2006-02-10 21:16 ` Ben Greear
0 siblings, 0 replies; 3+ messages in thread
From: Ben Greear @ 2006-02-10 21:16 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano wrote:
> Ben Greear <greearb@candelatech.com> writes:
>
>
>>I have a linux-2.6 repo with two branches off of 2.6.13.
>>
>>One branch (ben_v13) has just my own changes.
>>A second branch (work_v13) has the 2.6.13.5 patch, and I've also pulled
>>ben_v13 into it.
>
>
> "2.6.13.5"
> o---o---o---o
> / \ "work_v13"
> ---o "2.6.13" .---*
> \ /
> o---o---o
> "ben_v13"
>
> 'o' are commits, '*' is a merge.
>
>
>>Now, I made a small change to work_v13,
>
>
> "2.6.13.5"
> o---o---o---o
> / \ "work_v13"
> ---o "2.6.13" .---*---x
> \ / (new change)
> o---o---o
> "ben_v13"
>
>
>>... and I'd like to pull only
>>that changeset into ben_v13. Is there a way to do that w/out
>>having to export and apply a patch?
>
>
> I would have done things differently.
Yeah, the main problem is that I test in the combined tree
and forgot to change to the ben_v13 tree before making
my changes...
I'll try out the cherry-pick option..and if that doesn't
work, I'll just manually patch the changes into the ben_v13
tree.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-02-10 21:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-10 4:03 How to pull a single changeset from a child branch into a parent branch? Ben Greear
2006-02-10 5:01 ` Junio C Hamano
2006-02-10 21:16 ` Ben Greear
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).