How to git tag all submodules?

I want to note all the submodules of my project. I tried to do this with:

git submodule foreach git tag tagName

... but he just returns without errors, doing nothing.

Edit: here are the results of my attempt:

enter image description here

Can someone tell me how to mark all submodules correctly?

Note: this is a very similar question to this post , but the answer to this question suggested relying on sub-module links in a super project. However, I actually like the tag in the submodule repository.

+4
source share
1 answer

First, make sure your submodule folder has content:

git submodule update --init --recursive

Then just do:

 git submodule foreach git tag -l

tagName.
, .

, :

git submodule foreach git tag -m "tagName" tagName

, .

, gitlink, SHA1. .

+5

Source: https://habr.com/ru/post/1678376/


All Articles