Tracking external git repos merged via the `git subtree`

I am trying to create a good template for managing shared code and external dependencies in several projects. For reasons well documented elsewhere, using submodules has enough pitfalls that I tend to avoid. Starting with git 1.8, the subtree command is built in and seems to cover many of what I care about, but there are still a few basic scenarios that seem to be missing. I was hoping someone wrote some scripts on top of the official subtree function, which fills in the blanks.

What I want seems to be missing:

  • Keep track of what was added through the subtree, and which branch was specified.
  • Ability to do git subtree pull-all and push-all
  • As part of the latter, you can specify whether the subtree should be locked for a specific commit or last commit in a branch.

Are these things embedded in the command, and am I just missing something in the way they are used? I also have a requirement for this to work on Windows, in case it affects anything.

Thanks,

+4
source share
1 answer

No, such a team does not exist. A similar command is also very difficult to implement, since git -subtree does not store where the subtree comes from metadata. If you need such features, I would highly recommend submodules. However, they will also require some scenarios from you in order to achieve what you want.

0
source

Source: https://habr.com/ru/post/1469043/


All Articles