I have several git repositories for a web project that share a library of common code. I don't want to repeat the common code inside for each repo. What are some ways others have solved this problem?
Git submodules seem to get a lot of hate because they tend to cause more problems than they solve
I could just have a separate repository for the core lib, but then there would be no way for matching versions if the repositories are being developed by separate teams. (For example, if v1.0.2 in a repository requires v2.0.0 in the core lib, that information should be tracked somewhere).
In Android, build.gradle
more or less solves this problem. Is there something similar for git? For example:
compile 'com.android.support:appcompat-v7:25.0.1'
refers to a specific version of a remote dependency. (Source: Android docs)