{"thread":{"id":"29386","subject":"How to migrate a complex directory structure from SVN to GIT?","startedAt":"2012-01-17T19:33:57Z","lastAt":"2012-01-27T04:46:19Z","messageCount":4,"participants":["Asuka","Michael Haggerty","Jehan Bing","David Barr"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"182693","messageId":"1326828837924-7197567.post@n2.nabble.com","threadId":"29386","inReplyTo":null,"subject":"How to migrate a complex directory structure from SVN to GIT?","fromName":"Asuka","fromEmail":"c.bauers@gmx.de","sentAt":"2012-01-17T19:33:57Z","receivedAt":"2012-01-17T19:33:57Z","isPatch":false,"sender":{"key":"c.bauers@gmx.de","avatar":null},"body":"Hi there,\n\nI would like to migrate my svn repository to git. The structure looks like\nthe following:\n\nsvn\n   |_Project1\n         |_subproject1\n               |_branches\n                      |_branch1\n                      |_branch2\n               |_trunk\n               |_tags\n                      |_tagv1\n   |_Non-JavaProject\n         |_subproject\n   |_Project2\n          |_AnotherSubproject\n               |_SubSubproject\n          |_Subproject2\n               |_branches\n               |_tags\n          |_Subproject3\n               |_trunk\n          |_Subproject4\n               |_Subsubproject\n                       |_branches\n                       |_tags\n                       |_trunk\n\nI would like to migrate all branches and tags .. but unfortunately sometimes\nI have just a trunk directory and no branches or tags directory. Sometimes\nthe branches are in a subdirectory, sometimes in a subsubdirectory. So how\ncan migrate my svn in an efficient way?\n\nThanks in advance\nBest wishes\n\n--\nView this message in context: http://git.661346.n2.nabble.com/How-to-migrate-a-complex-directory-structure-from-SVN-to-GIT-tp7197567p7197567.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"182722","messageId":"4F16A264.9030503@alum.mit.edu","threadId":"29386","inReplyTo":"1326828837924-7197567.post@n2.nabble.com","subject":"Re: How to migrate a complex directory structure from SVN to GIT?","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2012-01-18T10:43:48Z","receivedAt":"2012-01-18T10:43:48Z","isPatch":false,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On 01/17/2012 08:33 PM, Asuka wrote:\n> I would like to migrate my svn repository to git. The structure looks like\n> the following:\n> \n> svn\n>    |_Project1\n>          |_subproject1\n>                |_branches\n>                       |_branch1\n>                       |_branch2\n>                |_trunk\n>                |_tags\n>                       |_tagv1\n>    |_Non-JavaProject\n>          |_subproject\n>    |_Project2\n>           |_AnotherSubproject\n>                |_SubSubproject\n>           |_Subproject2\n>                |_branches\n>                |_tags\n>           |_Subproject3\n>                |_trunk\n>           |_Subproject4\n>                |_Subsubproject\n>                        |_branches\n>                        |_tags\n>                        |_trunk\n> \n> I would like to migrate all branches and tags\n\nThis can be confusing because Subversion confounds the namespace for\nlines of development (trunk, branches, and tags) with those of filename\npaths.  The basic rule is: normally each trunk/branches/tag triplet\ncorresponds to a single project, and each project should be converted\ninto a separate git repository.\n\nIn your case it is hard to tell where the project boundaries are without\nmore information.\n\nIf some projects don't have branches or tags, that is OK; you can\nconfigure git-svn pretty flexibly.\n\nIf some have branches and/or tags but not trunk, give it a try; I'm not\nsure whether git-svn can handle it.\n\nIf some subprojects (including their trunk/branches/tags directories)\nare nested within the source code of the enclosing projects (thus\nentangling the namespaces), then you have chaos even in the Subversion\nworld.  Such a mess can probably also be rescued, but it will be more\ninvolved.  For example, you might use svndumpfilter to strip\nimproperly-nested projects out of (copies of) your Subversion repository\n*before* converting the enclosing project, or play some kind of\ngit-filter-branch tricks *after* the conversion.\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\nhttp://softwareswirl.blogspot.com/\n"},{"id":"182732","messageId":"4F1713D4.9000602@orb.com","threadId":"29386","inReplyTo":"1326828837924-7197567.post@n2.nabble.com","subject":"Re: How to migrate a complex directory structure from SVN to GIT?","fromName":"Jehan Bing","fromEmail":"jehan@orb.com","sentAt":"2012-01-18T18:47:48Z","receivedAt":"2012-01-18T18:47:48Z","isPatch":false,"sender":{"key":"jehan@orb.com","avatar":null},"body":"On 2012-01-17 11:33, Asuka wrote:\n> I would like to migrate all branches and tags .. but unfortunately sometimes\n> I have just a trunk directory and no branches or tags directory. Sometimes\n> the branches are in a subdirectory, sometimes in a subsubdirectory. So how\n> can migrate my svn in an efficient way?\n\n From the look of your example, each project is either a trunk, or have \nsubdirectories for trunk/branches/tags so I don't think it's a problem. \nIf you don't have branches or tags, just don't specify them when you \nclone your subversion repository.\n\nIf however you have a more complex layout, you can use \"git svn init\", \nthen edit .git/config to suit your needs, then run \"git svn fetch\".\nAnd by \"suit your needs\", I mean you can add multiple \"fetch=...\" lines.\nIn my case, I ended up having one \"fetch=...\" for each trunk, branch and \ntag.\nIt was not efficient, it took 2 weeks to convert <30k revisions, ~200 \nbranches/project, ~80 projects, but it works well enough for me.\n\n\tJehan\n"},{"id":"183157","messageId":"CAFfmPPNQRtxXSiLRMSwf85t1spdX12zVEQQea0yORK5hN8b0oA@mail.gmail.com","threadId":"29386","inReplyTo":"4F1713D4.9000602@orb.com","subject":"Re: How to migrate a complex directory structure from SVN to GIT?","fromName":"David Barr","fromEmail":"davidbarr@google.com","sentAt":"2012-01-27T04:46:19Z","receivedAt":"2012-01-27T04:46:19Z","isPatch":false,"sender":{"key":"davidbarr@google.com","avatar":"https://avatars.githubusercontent.com/u/220594?v=4"},"body":"> If however you have a more complex layout, you can use \"git svn init\", then\n> edit .git/config to suit your needs, then run \"git svn fetch\".\n> And by \"suit your needs\", I mean you can add multiple \"fetch=...\" lines.\n> In my case, I ended up having one \"fetch=...\" for each trunk, branch and\n> tag.\n> It was not efficient, it took 2 weeks to convert <30k revisions, ~200\n> branches/project, ~80 projects, but it works well enough for me.\n>\n>        Jehan\n\nThis is why we need to breath life into the git-remote-svn effort.\nWe should be able to handle imports of that size in minutes.\n(Cost of dumping from SVN aside.)\n\n--\nDavid Barr\n"}]}