On Fri, Sep 18, 2009 at 8:39 AM, Robert Sesek <[email protected]> wrote:
> On Fri, Sep 18, 2009 at 11:27 AM, Nico Weber <[email protected]> wrote:
>>
>> 2.) I often have 3-5 feature branches. When one of them is of them is
>> getting ready to submit, I usually rebase it on ToT before sending it
>> to the try servers. I do this thusly:
>>
>>   git checkout trunk
>>   git pull
>>   git checkout myfeaturebranch
>>   git rebase trunk
>>
>> (this can probably be done in an easier way, but it works and is
>> easily put into a bash alias, so I looked only briefly for a better
>> way, and didn't find anything). Now, when I want to work on the other
>> branches, I always rebase them to trunk when I switch to them, i.e. I
>> run
>>
>>   git checkout otherbranch
>>   git rebase trunk
>>
>> If I didn't use that branch for a week or so, the first step takes
>> quite some time to remove all the changes that I pulled in since last
>> using my branch, while the second step takes about the same time to
>> undo all the work that the first step did, which seems stupid. Is
>> there a command for "go to that branch, but rebase it immediately"?
>
> I do this:
> git fetch origin
> git rebase origin/trunk <branch I want to rebase>
> ... the above will download the latest from the central repo and then will
> rebase your branch onto origin/trunk. This works especially well if you
> create your branch tracking origin/trunk:
> git branch mybranch origin/trunk

The problem is that rebase checks out your old branch first, only to
throw it away, check out the new branch, and reapply the old branch as
a series of patches.  I don't know why it's written that way; there's
likely some interesting technical reason but I think the simpler goal
of "forward-port my stuff to tip of tree" can be done in a faster way.

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to