1

I've got a large monolithic Git repository. Several development units are working on different tasks and some of large folders not necessary to one unit, and other folders to the other unit. So in general I need to clone everything and ignore some sub-folders, it's not about cloning only one sub-folder.

I've read about git partial clone, but haven't found any practical usage. https://www.git-scm.com/docs/partial-clone

I would like to configure git locally on dev machines to ignore to clone some folders to decrease the volume of downloaded files, and also history and commits which Git tracks.

How to do this with Git?

Alexander Goida
  • 305
  • 1
  • 11
  • Possible duplicate of [How do I clone a subdirectory only of a Git repository?](https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository) – Aaron Digulla Apr 02 '19 at 15:23
  • I don't think it's clone, because I need to clone everything and ignore sub-folder, when the other question about ignoring everything and clone only sub-folder. – Alexander Goida Apr 02 '19 at 15:39
  • 1
    It's probably possible with filtering (there is an answer with an example) but that's complicated. I suggest to look into LFS to move the large files out of the repo and then clone with a reduced history. – Aaron Digulla Apr 02 '19 at 15:44
  • 1
    It seems I made it with such Git feature as "sparse checkout" http://schacon.github.io/git/git-read-tree.html#_sparse_checkout This is a kind of filtering and you can use exclusion rules for folders. Worked on my sample repo, but need to try on the larg one. – Alexander Goida Apr 03 '19 at 06:44

0 Answers0