1

I have a large monolithic project where the repository is currently about 1.5GB and I'm wondering if breaking it into smaller submodules and only working on the submodule would help speed up cloning time and keep the storage use the same without increasing it.

If I work on a submodule within the main repository, won't those changes be stored in the main repository and the submodule's repository effectively duplicating the changes and storage requirements?

Is this the right tool for the job, or is there another approach I can leverage to work on a small chunk whilst also having it "grouped" under 1 umbrella, so if I want to work on everything, I can easily do that.

Walter
  • 1,290
  • 2
  • 21
  • 46

1 Answers1

0

only working on the submodule would help speed up cloning time and keep the storage use the same without increasing it.

That would indeed speed up the cloning. See Splitting a subfolder out into a new repository.

If I work on a submodule within the main repository, won't those changes be stored in the main repository and the submodule's repository effectively duplicating the changes and storage requirements?

No: the parent repo needs to be updated with the new gitlink (new SHA1 of the subrepo you just modified), a special entry in the parent repo index.

That means, after an "add-commit-push" in the subrepo, you need to go back to the parent repo, add commit and push as well (to commit the gitlink)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250