Subject: Re: git-svn branch naming question

From: Peter Baumann <[email-masked]>
Date: Sat, 8 Dec 2007 17:56:57 +0100

On Sat, Dec 08, 2007 at 03:14:49PM +0100, Miklos Vajna wrote:
> On Sat, Dec 08, 2007 at 11:59:01AM +0100, Peter Baumann <[email-masked]> wrote:
> > Look up  --prefix in the manpage for git-svn.
> 
> great, --prefix is what i missed.
> 
> a related question: is it possible to avoid even the "remotes" prefix?
> 
> it could be useful when creating an incremental import of an svn repo.
> (ie when using git-svn as a replacement of git-svnimport.)
> 

git svn init --stdlayout creates this entry in your .git/config per default

  [svn-remote "svn"]
        url = https://url/to/your/svn/repo
        fetch = trunk:refs/remotes/trunk
        branches = branches/*:refs/remotes/*
        tags = tags/*:refs/remotes/tags/*

You could change this to

  [svn-remote "svn"]
        url = https://url/to/your/svn/repo
        fetch = trunk:refs/remotes/origin/trunk
        branches = branches/*:refs/remotes/origin/*
        tags = tags/*:refs/remotes/origin/tags/*

to get what --prefix origin would do.

 On the other hand you could forget completly the remote part by specifying

  [svn-remote "svn"]
        url = https://url/to/your/svn/repo
        fetch = trunk:refs/heads/trunk
        branches = branches/*:refs/heads/*
        tags = tags/*:refs/heads/tags/*

but I advice you to not do this. refs/remotes has a special meaning in git,
e.g.  you can't commit directly to it (which makes sense, because it only
tracks the state of the remote repo. On the other hand remote branches won't
get cloned per default.)

Side note, if you want to track only some branches, or if you have a strange
svn layout, you could use something like this:

  [svn-remote "svn"]
        url = https://url/to/your/svn/repo
        fetch = trunk:refs/remotes/origin/trunk
        fetch = branches/branchA:refs/remotes/origin/branchA
        fetch = branches/branchB:refs/remotes/origin/branchB
	...

-Peter