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

Re: hot to fix git svn import or just discard 'branches' folder

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Feb 4, 2009, 18:39 UTC
Message-ID
<D92EB2AE-392D-4F05-8DF3-999BE78C80FF@silverinsanity.com>
In-Reply-To
<7E976223-6794-4E87-94A5-DEA224759700@decodeideas.com>
On Feb 4, 2009, at 12:03 PM, Marius Seritan wrote:
Show 8 quoted lines
> I imported over night an svn repository with the command:
>
> git svn clone --prefix svn/ -r 860  http://svn.some.com/svn/ 
> someproject
>
> The svn repository uses the usual trunk, branches, tag so I  
> (wrongly?) assumed I do not need to pass any command switches  
> regarding the structure of the repo.

"git svn clone URL" attempts to act like "svn co URL", but with history. If you only want to download the trunk, then you should add "/trunk" to the end of the URL. If you want to capture all the branches, tags, etc you should use "--stdlayout" (also spelled "-s").

> I obviously did something wrong because now I have a git repository  
> with just one remote branch and it contains the folders trunk,  
> branches and tag. I do not want to reimport because it is taking  
> lots of time and bandwidth.

I believe fixing this without reimporting requires using "git filter- branch". I'm unfamiliar with it, so I can't help you with that part.

However, I'm curious as to why this took a lot of time because the "-r 860" on the command line should tell git-svn to only download a single revision. Is it a particularly repository?

~~ Brian
Previous: Marius SeritanNext: Marius Seritan
Message 2 of 5 in “hot to fix git svn import or just discard 'branches' folder”
  1. Marius SeritanFeb 4, 2009
  2. Brian GernhardtFeb 4, 2009
  3. Marius SeritanFeb 4, 2009
  4. Marius SeritanFeb 4, 2009
  5. Marius SeritanFeb 4, 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.