# create branch from svn repos

2 messages from 2010-04-27 to 2010-04-27. Participants: Ming Zhang, Dmitrijs Ledkovs.
Thread: https://gitlist.dev/t/23623

## Ming Zhang, 2010-04-27 20:59

Subject: create branch from svn repos
Message-ID: <j2h93552bad1004271359q63611fcdn82a3915a3bb74b25@mail.gmail.com>
URL: https://gitlist.dev/e/j2h93552bad1004271359q63611fcdn82a3915a3bb74b25%40mail.gmail.com

```
Hi All

I have a svn repos with this layout

trunk
tags
branches-- b1
                    b2
                    dir/ b3
                           b4

i used git-svn to clone a svn repos. and i have remote branches like

svn/b1
svn/b2
svn/dir

i can create a local branch from b1 or b2, or even dir with command like
git checkout -b local/b1 svn/b1

but if i want to create a local branch for b3 with command
git checkout -b local/b1 svn/dir/b3

it will fail with error messages like

fatal: git checkout: updating paths is incompatible with switching
branches/forcing
Did you intend to checkout 'svn/dir/b3' which can not be resolved as commit?

so is what i want to do feasible?

Thanks!

Ming

```

## Dmitrijs Ledkovs, 2010-04-27 23:25

Subject: Re: create branch from svn repos
Message-ID: <n2v86ecb3c71004271625r4f546c93v394c211f6beb27@mail.gmail.com>
URL: https://gitlist.dev/e/n2v86ecb3c71004271625r4f546c93v394c211f6beb27%40mail.gmail.com
In-Reply-To: <j2h93552bad1004271359q63611fcdn82a3915a3bb74b25@mail.gmail.com>

```
On 27 April 2010 21:59, Ming Zhang <blackmagic02881@gmail.com> wrote:
> fatal: git checkout: updating paths is incompatible with switching
> branches/forcing
> Did you intend to checkout 'svn/dir/b3' which can not be resolved as commit?
>
> so is what i want to do feasible?
>
> Thanks!
>
> Ming

$ git help svn

Read the last bits on how to define svn remote branches in the .git/config
update your .git/config
and do

$ git svn init $same_top_level_svn_url
$ git svn fetch

```
