When you commit in a git submodule, you need to go up to the super-project to do a second commit, which is the new hash of the submodule.
This is incredibly annoying, easy to forget and can cause all manner of problems if you don't do it.
What I want to do is:
What's the best way to figure out if you're in a submodule, where the super-project is, etc and automate this?
Maybe some kind of post-commit hook in the submodule?
Have you tried git-slave? This is exactly what it's designed to do.
You can also script that yourself. Be aware that there are 2 options on the git command itself that can help greatily: --work-tree
and --git-dir
. Using these you can act on any repo without leaving the current directory.
Then there is also git submodule foreach --recursive git push
.
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