I have a git project (repo1) including a single submodule (repo2). What I would like to achieve is to tag my project using an older commit of my submodule (like HEAD - 3).
I tried with a checkout of the submodule to the commit I want, but checkout is wrong since, committing in my project won't track the proper revision. I tried resetting my submodule to the commit I want, commit the project, and then pulling the submodule and committing the project, which is also wrong because:
$ git submodule update
fatal: reference is not a tree: 2c3d1a5936aa9469ecc1442cd4b101e1bbd3aada
Unable to checkout '2c3d1a5936aa9469ecc1442cd4b101e1bbd3aada' in submodule path 'repo2'
What would be the best -- as well as nicest -- procedure ?
Git submodule head 'reference is not a tree' error gives a beginning of an answer, but it stills links the HEAD of repo2 and not a chosen commit...
Suppose now that the tag is done, how can I tell my repo1 to set repo2 in the proper state for a tag:
git checkout 0.0.1
According to git submodule update, a simple
git submodule update
should suffice. It doesn't checkout my submodule to the specified commit. Why ? Is that a ... bug ?