I have this situation with git version 2.8.0.windows.1
.
I have one "release" branch of the main project and I push there everytime I've a new release.
This project has a submodule that is developed in parallel, so I expect many commits there.
Project Master branch and Submodule Master branches goes ahead (almost) in parallel.
Master Commit 1 => Master Commit 2 => Master Commit 3 => Master Commit 4
Submodule Commit 1 => Submodule Commit 2 => Submodule Commit 3 => Submodule Commit 4
In this case Master Commit 4 is aligned with Submodule Commit 4.
The issue arises when someone tries to get the release branch too late.
So if I push the release branch at Master Commit 1 and someone pull release branch when we are at Master Commit 4 we have a misalignment (because release is related to Master Commit 1, while now we are on Submodule Commit 4).
The solution I see is to coerce somehow Submodule Commit 1 to release branch, but I don't know how yet.
I know that a great solution would be just to add a branch or tag on the submodule as explained here.
But I've no authority over the submodule repository, so it won't be easy for me to set branches or tags there.
Are there any workarounds to coerce a specific submodule commit on my release branch and not just a submodule branch/tag?
git checkout release
git pull origin release
, but it doesn't restore the submodule to the release version (I still have the master submodule). I tried withgit submodule sync
with no success too. – Jackknife