Hacker News new | ask | show | jobs
by samtheprogram 695 days ago
I think submodules make sense in a lot of use cases, but a gotcha I saw with a team introduced to them recently is that pulling down from a branch or switching branches doesn’t update the submodule and/or stop you from changing branches if it is modified without being committed in some way.

If I could have submodules that operated that way I think submodules would be a lot more straightforward to newcomers.

2 comments

Note that this won't solve all cases. For example, you still have to watch out when merging branches with different submodule commit hashes that you run submodule update while merging.
Yup, submodules are actually ok. Like with most git issues, it's more of a tooling UX problem then an architecture deficiency.