0

I have 4 git projects:

  1. utils
  2. tool_a
  3. tool_b
  4. main_app

tool_a uses utils as submodule
tool_b uses utils as submodule
main_app uses utils as submodule

now I want to add to main_app tool_a and tool_b as submodules, which leads to having utils module 3 times.

I want to be able to use tool_a and tool_b as a standalone projects (with utils of course).

Is there a way to avoid the duplicating utils module?

Thanks

Avi Elgal
  • 149
  • 1
  • 3
  • 9
  • **1.** Why `utils` is a submodule at all? Submodules are required during development, dependencies are required during run-time. So my 1st advice is to rethink the entire project structure and use `utils` as a run-time dependency, not as a submodule. **2.** Submodules are checked out at commits specified at the superproject. If you want to have 1 (one) copy of `utils` you must make sure all your projects points to the same commit in the `utils` repository. After that you can try symlinks: https://stackoverflow.com/q/4115817/7976758 – phd Jun 05 '23 at 17:48
  • Also see https://stackoverflow.com/q/63885957/7976758 found in https://stackoverflow.com/search?q=%5Bgit-submodules%5D+avoid+duplication – phd Jun 05 '23 at 17:56

0 Answers0