What are the pros and cons of Git submodule and Repo? [duplicate]
It just so happens that we share a library between 3 different mobile platforms. There is much debate within the office on what is the best tool to use to manage this library. Repo (Android) from what I read is a tool built on top of Git used for managing the hundreds of Git repositories used for Android, whilst Git submodule is already part of Git.
We would ideally like to have this library in a separate repository and be able to simply integrate it within each of the different mobile applications.
What are the pros and cons of using git submodule or Repo as approaches for managing a shared library that is used between various platforms?
Git submodules is built for this. We've been using submodules for libraries and more. The progit.org/book has a great chapter about submodules and shows an example of upgrading a library from one version to another.
The main difference is that Git submodule tracks and Repo does not. The result is that checking out an exact commit of an old version is only possible with git
.
The second most important difference is that Git is popular and Repo is not. The result is that finding solutions for Git is faster.
Maybe the only reason Repo exists is that Git submodule did not exist at the time of Repo's creation.
精彩评论