I have tried git submodule. Although it can solve my problem of sharing repository in projects, but using submodule has 2 issues that troubles me:
These 2 problems introduces errors easily for daily development work. I found git slave may solve my problem.
Is there any side effect of using git slave?
Or is there are good practices to avoid the above issue in git submodule?
The main point to be aware is quite precely described in the "Gitslave is not perfect" section:
Less obviously, there is a very loose relationship between commits in different repositories.
You cannot easily and precisely determine what commit/SHA any other repository was at when a particular commit was made (though you can approximate and assume pretty easily). Only tags provide exact synchronization between different repositories.
And that is bad in term of reproducibility (one main goal of a VCS: being able to reproduce the state of an environment at any point in its history).
You need to add tags (with a certain naming convention) in order to get back some of the tight correspondence you need between a parent repo and its sub-repos (and which is naturally present with submodules, as I explain in the true natrue of submodules).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With