# Question: How to rebase my changes on a new base (ref)?

2 messages from 2011-03-19 to 2011-03-19. Participants: Ilyes Gouta.
Thread: https://gitlist.dev/t/26785

## Ilyes Gouta, 2011-03-19 08:50

Subject: Question: How to rebase my changes on a new base (ref)?
Message-ID: <AANLkTinnGw-u-snLwTUzry2PRmTUD7oDGjedJLhkJGoh@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinnGw-u-snLwTUzry2PRmTUD7oDGjedJLhkJGoh%40mail.gmail.com

```
Hi,

I've been tracking a project, via the master branch, customizing
certain aspects and applying my changes into a separate local branch
B. In the mean time, there is this new remote branch
origin/release_2.1, that was created for releasing a certain version.
It happened that I merge entirely that master branch into my local
branch, periodically, in order to get the latest change sets. It also
happens in that projects, that commits from branch C get merged into
the project's origin/master.

I'd like to do the following: Take all the those changes I made
against origin/master, checkout a local branch based on
origin/release_2.1 and apply them on it. This way I can get my
customizations re-based against that particular branch (stream)
instead of origin/master being the parent/upstream.

Is it possible to achieve that? does it involves a kind of git
rebasing (--onto ?). So far, I used exclusively a merge flow to
maintain my private branch B in sync with origin/master and that right
now that code base is more recent than origin/release_2.1.

Here is the structure, in ASCII, of the project: (best viewed with a
proportional font)

origin/master
|
|
|  |  |
|  |  |
|  |  |
+--|--\ (sometimes commits in origin/release_2.1 go into origin/master)
|  |  |
|  |  |
|  |  |
|  |  |
|  |  |
|  +  | (git merge origin/master into my_private_branch)
| /|  |
+  |  |
|  |  |
|  |  |
|  +  | (git merge origin/master into my_private_branch)
| /|  |
+  |  |
|  |  | origin/release_2.1
|  |  /
+--|-/
|  |
|  | my_private_branch (git checkout -b)
|  /
+/
|
|

Regards,

-Ilyes

```

## Ilyes Gouta, 2011-03-19 08:54

Subject: Re: Question: How to rebase my changes on a new base (ref)?
Message-ID: <AANLkTi=8hbaMZDhrdC1pppk5OBejTuaMSpG4BCr_TpGs@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3D8hbaMZDhrdC1pppk5OBejTuaMSpG4BCr_TpGs%40mail.gmail.com
In-Reply-To: <AANLkTinnGw-u-snLwTUzry2PRmTUD7oDGjedJLhkJGoh@mail.gmail.com>

```
Please CC me in the reply. I'm not registered to the mailing-list. Thanks!

-Ilyes

On Sat, Mar 19, 2011 at 9:50 AM, Ilyes Gouta <ilyes.gouta@gmail.com> wrote:
> Hi,
>
> I've been tracking a project, via the master branch, customizing
> certain aspects and applying my changes into a separate local branch
> B. In the mean time, there is this new remote branch
> origin/release_2.1, that was created for releasing a certain version.
> It happened that I merge entirely that master branch into my local
> branch, periodically, in order to get the latest change sets. It also
> happens in that projects, that commits from branch C get merged into
> the project's origin/master.
>
> I'd like to do the following: Take all the those changes I made
> against origin/master, checkout a local branch based on
> origin/release_2.1 and apply them on it. This way I can get my
> customizations re-based against that particular branch (stream)
> instead of origin/master being the parent/upstream.
>
> Is it possible to achieve that? does it involves a kind of git
> rebasing (--onto ?). So far, I used exclusively a merge flow to
> maintain my private branch B in sync with origin/master and that right
> now that code base is more recent than origin/release_2.1.
>
> Here is the structure, in ASCII, of the project: (best viewed with a
> proportional font)
>
> origin/master
> |
> |
> |  |  |
> |  |  |
> |  |  |
> +--|--\ (sometimes commits in origin/release_2.1 go into origin/master)
> |  |  |
> |  |  |
> |  |  |
> |  |  |
> |  |  |
> |  +  | (git merge origin/master into my_private_branch)
> | /|  |
> +  |  |
> |  |  |
> |  |  |
> |  +  | (git merge origin/master into my_private_branch)
> | /|  |
> +  |  |
> |  |  | origin/release_2.1
> |  |  /
> +--|-/
> |  |
> |  | my_private_branch (git checkout -b)
> |  /
> +/
> |
> |
>
> Regards,
>
> -Ilyes
>

```
