5

I would like to import a SVN repository into a GitHub Enterprise repository

There are many questions related to this matter and most of them can be addressed either with Git submodules or Git subtree.

In my case I have two repositories:

  • The main project repository
  • The modules repository (a big SVN repository over 2 GB)

This module repository has the following architecture:

foolib/
   moduleA/
      ...
   moduleB/
      ...
   ...

For the project, only few modules from foolib are used as svn:externals. For example this main project only uses moduleA from foolib.

As mentioned in this question one possible solution is to use sparse-checkout. I'm guessing Git subtree would also do the trick. Unfortunately it doesn't solve the main issue.

If my project is very small, as long as I get something from foolib, even with sparce-checkout, I will retrieve the whole history of foolib (e.g. 2 GB). This issue doesn't exist with SVN because an svn:externals property only fetches what it needs, not the whole history.

I can imagine to do foolish things like recreating a local sparse repository dynamically using the commits listed in git log --follow foolib/moduleA. But I assume this is not a good solution.

What would be the correct workflow to get a similar behavior in Git without having to fetch the whole history of foolib everything I need only few modules?

nowox
  • 25,978
  • 39
  • 143
  • 293
  • "one possible solution": to which problem? Where is your git repo? Or are you using git-svn? I am still confused. – VonC Aug 03 '17 at 06:46
  • @VonC, I've edited my question. The main issue there is with `submodules`, `sparse-checkout` or `subtree` I will always get the whole history of `foolib` which is huge. I would like to avoid this somehow. – nowox Aug 03 '17 at 08:33
  • @VonC Any news? – nowox Aug 16 '17 at 08:15
  • Could you consider https://help.github.com/articles/splitting-a-subfolder-out-into-a-new-repository/ in order to isolate each module in its own repo? (once `foolib` has been imported from SVN into one giant Git repo) – VonC Aug 16 '17 at 08:17
  • This can help splitting the giant Git repo into smaller ones – nowox Aug 16 '17 at 08:19
  • Yes, that is the idea. That way, you can define a parent project with, as submodues, only the subrepos you need. – VonC Aug 16 '17 at 08:20

0 Answers0