threads / discuss / 43653

Re: Rebasing part of a branch

Subject: Re: Rebasing part of a branch

## tl;dr

2 messages between Nov 2, 2006 and Nov 2, 2006.

replies: 1people: 2as markdown or json

Andy Parkins· Nov 2, 2006, 10:45 UTC · lore

Rebasing part of a branch

Hello,
Is there a way to rebase part of a branch?  For example
                        H---I---J topicB
                       /
              E---F---G  topicA
             /
A---B---C---D  master
And I want:
             H---I---J  topicB
            /
            | E---F---G  topicA
            |/
A---B---C---D  master
Of course,
 
 git-checkout topicB
 git-rebase master

Doesn't work, because the common ancestor is D, which is master, and there is nothing to do.

Of course I can cherry-pick, but is there something like
 git-rebase --limit topicA master
Or some git-magic I can work?
Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
Jakub Narebski· Nov 2, 2006, 11:15 UTC · re: Andy Parkins · lore
Andy Parkins wrote:
Show 17 quoted lines
> Hello,
> 
> Is there a way to rebase part of a branch?  For example
> 
>                         H---I---J topicB
>                        /
>               E---F---G  topicA
>              /
> A---B---C---D  master
> 
> And I want:
> 
>              H---I---J  topicB
>             /
>             | E---F---G  topicA
>             |/
> A---B---C---D  master
We have
 git-rebase [--merge] [--onto <newbase>] <upstream> [<branch>]

Try then $ git rebase --onto master topicA topicB

(if you checked out topicB, you don't need last topicB in git-rebase).
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

← back to recent threads