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

Re: How to prefix existing svn remotes?

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jan 23, 2009, 11:13 UTC
Message-ID
<4979A64E.6030608@drmicha.warpmail.net>
In-Reply-To
<20090122173211.GB21798@locahost>
Sébastien Mazy venit, vidit, dixit 22.01.2009 18:32:
Show 26 quoted lines
> Hi all,
> 
> 
> I created a few months ago a git-svn repository using:
> git svn clone -s https://my_svn_repo .
> 
> wich also created the following remotes:
> git branch -r
>   branch0
>   tags/tag0
>   trunk
> 
> I would like to prefix theses remotes, so that it shows:
> git branch -r
>   prefix/branch0
>   prefix/tags/tag0
>   prefix/trunk
> 
> Of course I should have used the -prefix back when creating the repo but
> it's too late. 'git help svn' doesn't explain how to achieve that and
> simply editing .git/config to add the missing prefix will cause the next
> 'git svn fetch' to download again the whole history (which in my case is
> huge).
> 
> 
> Is it possible? Did I miss something obvious?
Yes! Depends!
The following works for me:
0) fetch to make sure you're current (optional)
1) edit .git/config and add the prefix (right hand side of the
refpsecs), or really rename in any way you want
2) rename the existing remote branches in the same way

The next git svn fetch will rebuild the map file (which is fast) but not refetch any svn revisions you already have.

Regarding the renaming: Either I'm dumb or current git branch can't rename git svn branches. I guess it's because they are remotes but not really. I had to resort to git update-ref. I'll look into that.

Michael
Previous: Sébastien MazyNext: Sébastien Mazy
Message 2 of 6 in “How to prefix existing svn remotes?”
  1. Sébastien MazyJan 22, 2009
  2. Michael J GruberJan 23, 2009
  3. Sébastien MazyJan 23, 2009
  4. Michael J GruberJan 23, 2009
  5. Sébastien MazyJan 23, 2009
  6. Jakub NarebskiJan 23, 2009

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.