Skip to content

Comment on Git Submodules as a Package Managerparent

Comments

Git doesn't support them very well. Bugs are disappointing frequent

I can't remember any "bug" in the submodule machinery. If you find one, report to the Git mailing list, they very receptive.

Having to constantly remember `git submodule update --init --recursive`

Set this config: `git config submodule.recurse true`

IMO they're almost always the wrong solution.

Yeah... but sometimes they are the only feasible solution, especially when the dependency needs to be shared across projects that use incompatible dependency managers and Git is the only common denominator between them...

Set this config: `git config submodule.recurse true`

Well that does save a flag at least so thanks! But I still have to run the command.

There is actually a flag to do submodule update automatically when you checkout or switch branches but DO NOT USE IT! It is known to be buggy and can break your .git directory in a way that is pretty much "delete everything and clone from scratch".

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.