I would like to tag all of the submodules of my project. I tried to do that with:
git submodule foreach git tag tagName
... but it appears to just return with no errors, having done nothing.
Edit: Here are the results of my attempt:
Can someone tell me how to properly tag all submodules?
Note: this a very similar question to this post, but the answer for that one suggested to rely on the submodule refs in the super-project. I, however, would actually like a tag in the submodule's repo.
First, make sure your submodule folder have a content:
git submodule update --init --recursive
Then, simply do:
git submodule foreach git tag -l
You should see, for each submdule, tagName
.
Meaning your previous command did indeed tag those submodules.
I would recommend to make an annotated tag though, not a lightweight one:
git submodule foreach git tag -m "tagName" tagName
That means you can push that tag from each submodule.
If you just tag at the parent repo level, that will include the submodule gitlink, that is their SHA1. That could be enough in your case.
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