1

We have a git branch with huge number of java and SQL files (Approx. more than 50,000+ files). Cloning this branch to the local machine is taking too much time (Approx. more than 30 mins). Usually, we don't require the whole branch code, only need a sub-directory.

Please share some information, how to clone a specific sub directory from git using Eclipse.

iamsumesh
  • 646
  • 4
  • 8
  • 22
  • 1
    It might be annoying how slow the initial clone is, but after that any updates should be very fast because you only download the changes since the last update. – Jonah Graham Jan 27 '16 at 20:44

1 Answers1

2

With Git you can clone a repository without checking out a branch into the work directory git clone --no-checkout. But Git will always clone the entire repository. The only limit you can specify is the depth, i.e.

After that you can checkout only those directories you are interested in (see How do I clone a subdirectory only of a Git repository?, please pay attention to @StijndeWitt's comment). But if cloning is what takes long, that won't help you much.

EGit, however, does not (directly) support cloning without checking out the work directory, neither does it support sparse checkouts

I would probably restructure the repository, but how of course dependson what those files are for, when they are used, if/how the number can be reduced, etc.

Community
  • 1
  • 1
Rüdiger Herrmann
  • 20,512
  • 11
  • 62
  • 79