Rebasing Git Branches

Category: By AG
While trying to rebase my git repos based on 2.6.18 to the latest kernel, I faced some problems. Initially I had started with 2.6.18, converted it into a brand new git repo locally and started doing my changes. Now rebasing to the new kernel is difficult with the default options available in git. Here, a tool called Stacked git comes in handy.

I'm not too conversant with either of the tools, so with some help from IRC and with some experimentation I was able to do it with the following sequence of commands:
# stg init
# stg uncommit -n
(this saves the commits as individual patches in .git/patches/<branch-name>/patches/ directory)
# git remote add linus git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
# fetch linus
# git checkout -b mybranch linus/master
(where 'master' is the current branch to which changes have been made, 'mybranch' is the new branch that will be created)
# git reset --hard v2.6.21 (to have a known good version of upstream)
# stg init (again)

Finally for every individual patch created in .git/patches/<branch-name>/patches/ directory with the step above, do:
# stg pick <patchname>@master ('patchname' is the name of patch)

A list of patches can be obtained with
# stg series -b master

0 comments so far.

Something to say?