Subject: Re: submodules : switching to an older commit/Tag in project with submodules

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Thu, 16 Aug 2018 20:41:58 +0200

On Thu, Aug 16 2018, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason <[email-masked]> writes:
>
>> On Thu, Aug 16, 2018 at 12:54 PM, Shani Fridman
>> <[email-masked]> wrote:
>>>
>>> Hi everybody,
>>>
>>> I've got a question regarding submodules -
>>>
>>> I'm working on a git project with submodules connected to it, and pulling changes from them every month (more or less).
>>> Sometimes I need to checkout older versions of the project (tags or specific commits), that needs the older versions of the submodules as they were when I defined the tag. The problem is, that the checkout only changes the superProject directories, and not the submodules... I have to checkout the relevant submodules commit manually.
>>>
>>> Have you came across the same problem? Any idea what can I do?
>>
>> You run "git submodule update".
>
> The problem is, some people consider that I have to do things
> "manually" X-<.

I may be wrong, but I read that part as e.g. cd-ing into each submodule
dir, and checking out the commit you see in "git diff" from the
top-level, hence the suggestion.