Re: Can't get git rebase --onto to work
- From
Howard Miller <howard@e-learndesign.co.uk>
- Date
- Jun 2, 2011, 11:28 UTC
- Message-ID
- <BANLkTimJQPvJ2oJh9BbcoZ-1ktSdAzTm2g@mail.gmail.com>
- In-Reply-To
- <20110602111825.GC4709@Imperial-SSD-Overlord>
> Can you please also point out which section of the doc caused you > confusion? > >
Ok... this is exactly my situation (and solution)
"First let’s assume your topic is based on branch next. For example, a feature developed in topic depends on some functionality which is found in next.
o---o---o---o---o master
\
o---o---o---o---o next
\
o---o---o topic
We want to make topic forked from branch master; for example, because
the functionality on which topic depends was merged into the more
stable master branch. We want our tree to look like this: o---o---o---o---o master
| \
| o'--o'--o' topic
\
o---o---o---o---o next
We can get this using the following command:git rebase --onto master next topic"
However, I didn't look at the HEADs (seems stupid now). What I was aiming for was (simply) for 'master' to have the 'topic' branch changes (the delta between next and topic being applied to master if you will). The only outstanding step was to checkout master and merge topic (which will always bee fast-forward, of course).
It's the topic branch that gets rebased - obvious (now) but I interpreted it as the master branch getting modified (--onto master i.e. play the changes 'onto' master and modify master).
I didn't read it carefully enough - makes sense now.