I am using a git submodule in a very usual way. The way how people typically update a submodule is by checking it out, pulling something in the submodule and then commiting outside.
Now, I typically don't develop those modules in the same place. For me it's more comfortable to develop those two modules in different places. How do I just tell my git project that one submodule has changed and is now at commit XYZ?
I think there's a chance that there's a setting somewhere in .git
that I could modify.
you can do with this, as follows:
git update-index --add --cacheinfo mode,sha1,submodule_path
the mode
value can get from git ls-files --stage submodule_path
git update-index reference
A self-explanatory example :
git update-index --cacheinfo 160000,03d7dff560ac8ed64f16e763204b04ce91ca5faf,submodules/submodule
Explanation:
Remember, this only updates the index, you are still expected to commit the change!
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