Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: How to create a tag that also include submodules?

Tags:

git

tags

I got a project with many submodules, I just made a release and I want to tag it all.

I want to create a point where I can checkout in the future and it will include the current code of my project along with all the current code of all submodules.

like image 363
Ilya Gazman Avatar asked Dec 28 '25 18:12

Ilya Gazman


1 Answers

When you tag a commit, you are tagging the version of your submodules that is being used by that commit.

When you use a submodule, your commit includes the SHA of the commit in the submodule that your code is currently using. When you update the code in your submodule, you will see that you have changes to commit (the new SHA) in the super project. So, a tag will naturally work the way you want.

like image 72
dontangg Avatar answered Dec 31 '25 00:12

dontangg