Git 1.8.2 added the possibility to track remote branches with submodule (which is awesome).
# add submodule to track master branch
git submodule add -b master [URL to Git repo];
# update your submodule
# --remote will also fetch and ensure that
# the latest commit from the branch is used
git submodule update --remote
.gitmodules looks like:
[submodule "libraries/shared_libraries"]
path = libraries/shared_libraries
url = https://user@bitbucket.org/team/shared_libraries.git
branch = develop
In our dev shop, all developers use Git >v1.8.2. However, our QA, staging & production servers run either RHEL 6.5 or CentOS, which has 1.7.1 OOTB.
These boxes are typically "pull only", and aren't used to commit code. What should we expect to happen when using "git submodule init/update" from our boxes running 1.7.1? It this a recipe for disaster, or is it a supported use case?