We are moving our (huge) project to git and we are thinking about using submodules. Our plan is to have three different heads in the superproject:
release, stable, latest
The project leads will handle the release and stable branches. They will move the submodules as required.
The issue is the "latest" head. We would like the superproject "latest" head to track the master branches of all the submodules (automatically). And also it would be great if it would show the history of all commits to the submodule.
I have looked at gitslave, but it is not quite what we want. Any suggestions?
Edit (2020.12.28): GitHub change default master branch to main branch since October 2020. See https://github.com/github/renaming
This answer below still reflect the old naming convention.
Update March 2013
Git 1.8.2 added the possibility to track branches.
If you had a submodule already present you now wish would track a branch, see "how to make an existing submodule track a branch".
Also see Vogella’s tutorial on submodules for general information on submodules.
Note:
See
git submoduleman page:See commit b928922727d6691a3bdc28160f93f25712c565f6:
Original answer (February 2012):
A submodule is a single commit referenced by a parent repo.
Since it is a Git repo on its own, the "history of all commits" is accessible through a
git logwithin that submodule.So for a parent to track automatically the latest commit of a given branch of a submodule, it would need to:
gitslave (that you already looked at) seems to be the best fit, including for the commit operation.
Other alternatives are detailed here.