# git-svn multiple branches and merging

2 messages from 2009-03-02 to 2009-03-12. Participants: Igor Lautar.
Thread: https://gitlist.dev/t/18089

## Igor Lautar, 2009-03-02 12:09

Subject: git-svn multiple branches and merging
Message-ID: <5fdd0830903020409j6e2b5269ubfb3ae6fe8266734@mail.gmail.com>
URL: https://gitlist.dev/e/5fdd0830903020409j6e2b5269ubfb3ae6fe8266734%40mail.gmail.com

```
Hi All,

I'm using git-svn to manage quite large svn repository. This
repository also does not follow 'general' svn rules about how to name
branches.

So we have something like:
trunk -> development
branches\version1 -> version1 maintenance
branches\custom\version1_fix -> customized version1 with certain fixes

etc.

When importing, I've only imported trunk and branches I'm interested
in. Thus, I have multiple remotes for which git-svn does not know they
are related (or how they branched from each other). Also, I have not
imported whole history, as its just to much trouble.

Now, I want to start a new branch, lets say branches\dev1, which is
branches from trunk. This will be used for various improvements, which
do not go to trunk immediatelly.
I also want to keep this branch in sync with main trunk.

Up to now, I have been doing this by git-cherry-pick all changes from
dev1 branch point. Is there a better way to do? Note that branch dev1
in git-svn does not know about previous commits in trunk (git remote
ref was initialized from branch point for dev1).

Just merging trunk (represented by a remote in git-svn) makes a mess
(as expected). Basically, what I want to do is tell git-svn that merge
was already done up to a certain point from that branch so git-merge
then only picks up new changes from that point on (and the ones that
have not been cherry-picked).

Is there a way to get out of this mess? I'm fine with cherry-pick, but
it requires some manual labor (like remembering/finding last
cherry-picked commit).

Thank you,
Igor

```

## Igor Lautar, 2009-03-12 09:31

Subject: Re: git-svn multiple branches and merging
Message-ID: <5fdd0830903120231t2ba2f126of41030161869cd33@mail.gmail.com>
URL: https://gitlist.dev/e/5fdd0830903120231t2ba2f126of41030161869cd33%40mail.gmail.com
In-Reply-To: <5fdd0830903020409j6e2b5269ubfb3ae6fe8266734@mail.gmail.com>

```
Hi,

Figured out a (little) better way.

Say A is point where last merge was done and B is head of branch we
want to cherry-pick from:

for c in $(git-rev-list --reverse A...B); do git-cherry-pick $c; done

I'm sure for can be replaced with something better, but it works for
me. However, I still need last merge (cherry-pick) point. It would be
nice to hear if anybody has a better idea...

Regards,
Igor

On Mon, Mar 2, 2009 at 1:09 PM, Igor Lautar <igor.lautar@gmail.com> wrote:
> Hi All,
>
> I'm using git-svn to manage quite large svn repository. This
> repository also does not follow 'general' svn rules about how to name
> branches.
>
> So we have something like:
> trunk -> development
> branches\version1 -> version1 maintenance
> branches\custom\version1_fix -> customized version1 with certain fixes
>
> etc.
>
> When importing, I've only imported trunk and branches I'm interested
> in. Thus, I have multiple remotes for which git-svn does not know they
> are related (or how they branched from each other). Also, I have not
> imported whole history, as its just to much trouble.
>
> Now, I want to start a new branch, lets say branches\dev1, which is
> branches from trunk. This will be used for various improvements, which
> do not go to trunk immediatelly.
> I also want to keep this branch in sync with main trunk.
>
> Up to now, I have been doing this by git-cherry-pick all changes from
> dev1 branch point. Is there a better way to do? Note that branch dev1
> in git-svn does not know about previous commits in trunk (git remote
> ref was initialized from branch point for dev1).
>
> Just merging trunk (represented by a remote in git-svn) makes a mess
> (as expected). Basically, what I want to do is tell git-svn that merge
> was already done up to a certain point from that branch so git-merge
> then only picks up new changes from that point on (and the ones that
> have not been cherry-picked).
>
> Is there a way to get out of this mess? I'm fine with cherry-pick, but
> it requires some manual labor (like remembering/finding last
> cherry-picked commit).
>
> Thank you,
> Igor
>

```
