git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-svn branch naming question

From
PBPeter Baumann <waste.manager@gmx.de>
Date
Dec 8, 2007, 16:56 UTC
Message-ID
<20071208165657.GC2844@xp.machine.xx>
In-Reply-To
<20071208141449.GH3199@genesis.frugalware.org>
On Sat, Dec 08, 2007 at 03:14:49PM +0100, Miklos Vajna wrote:
Show 10 quoted lines
> On Sat, Dec 08, 2007 at 11:59:01AM +0100, Peter Baumann <waste.manager@gmx.de> 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
Previous: Miklos VajnaNext: Miklos Vajna
Message 4 of 13 in “git-svn branch naming question”
  1. Miklos VajnaDec 8, 2007
  2. Peter BaumannDec 8, 2007
  3. Miklos VajnaDec 8, 2007
  4. Peter BaumannDec 8, 2007
  5. Miklos VajnaDec 8, 2007
  6. Miklos VajnaDec 9, 2007
  7. Björn SteinbrinkDec 9, 2007
  8. Miklos VajnaDec 9, 2007
  9. Eric WongDec 9, 2007
  10. Miklos VajnaDec 9, 2007
  11. Eric WongDec 9, 2007
  12. Harvey HarrisonDec 9, 2007
  13. Miklos VajnaDec 9, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.