I want to checkout a specific past commit of a git repository, let's say its hash is 'a1bc2def3':
git checkout a1bc2def3
The git repository makes heavy use of submodules. As their latest version is incompatible with the old commit, I want to checkout the latest commit of each submodule at the time of the local commit 'a1bc2def3'.
Do you know if there is a way to achieve that?
All you have to do is to run
git submodule update
after your checkout operation in the superproject.
Your subprojects (submodules) will then be checked out to the commit they were at when your superproject commit was created (they one that you have just check out with e.g. git checkout a1bc2def3).
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