git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* submodules : switching to an older commit/Tag in project with submodules
@ 2018-08-16 10:54 Shani Fridman
  2018-08-16 14:56 ` Stefan Beller
  2018-08-16 18:13 ` Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 5+ messages in thread
From: Shani Fridman @ 2018-08-16 10:54 UTC (permalink / raw)
  To: git@vger.kernel.org


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?

Thank you in advance,

Shani

This message (including any attachments) issued by RAFAEL- ADVANCED DEFENSE SYSTEMS LTD. (hereinafter "RAFAEL") contains confidential information intended for a specific individual and purpose, may constitute information that is privileged or confidential or otherwise protected from disclosure. If you are not the intended recipient, you should contact us immediately and thereafter delete this message from your system. You are hereby notified that any disclosure, copying, dissemination, distribution or forwarding of this message, or the taking of any action based on it, is strictly prohibited. If you have received this e-mail in error, please notify us immediately by e-mail mailto:lawraf@rafael.co.il and completely delete or destroy any and all electronic or other copies of the original message and any attachments thereof.

________________________________________

This message (including any attachments) issued by RAFAEL- ADVANCED DEFENSE SYSTEMS LTD. (hereinafter "RAFAEL") contains confidential information intended for a specific individual and purpose, may constitute information that is privileged or confidential or otherwise protected from disclosure. If you are not the intended recipient, you should contact us immediately and thereafter delete this message from your system. You are hereby notified that any disclosure, copying, dissemination, distribution or forwarding of this message, or the taking of any action based on it, is strictly prohibited. If you have received this e-mail in error, please notify us immediately by e-mail mailto:lawraf@rafael.co.il and completely delete or destroy any and all electronic or other copies of the original message and any attachments thereof.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: submodules : switching to an older commit/Tag in project with submodules
  2018-08-16 10:54 submodules : switching to an older commit/Tag in project with submodules Shani Fridman
@ 2018-08-16 14:56 ` Stefan Beller
  2018-08-16 18:13 ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Beller @ 2018-08-16 14:56 UTC (permalink / raw)
  To: Shani.Fridman; +Cc: git

On Thu, Aug 16, 2018 at 4:55 AM Shani Fridman
<Shani.Fridman@visionmap.com> 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?

git checkout learned about the --recurse-submodules flag some time
ago. If that is what you need, just set 'git config submodule.recurse
true' so you don't have to pass that flag every time.

Hope that helps,
Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: submodules : switching to an older commit/Tag in project with submodules
  2018-08-16 10:54 submodules : switching to an older commit/Tag in project with submodules Shani Fridman
  2018-08-16 14:56 ` Stefan Beller
@ 2018-08-16 18:13 ` Ævar Arnfjörð Bjarmason
  2018-08-16 18:18   ` Junio C Hamano
  1 sibling, 1 reply; 5+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2018-08-16 18:13 UTC (permalink / raw)
  To: Shani Fridman; +Cc: git@vger.kernel.org

On Thu, Aug 16, 2018 at 12:54 PM, Shani Fridman
<Shani.Fridman@visionmap.com> 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".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: submodules : switching to an older commit/Tag in project with submodules
  2018-08-16 18:13 ` Ævar Arnfjörð Bjarmason
@ 2018-08-16 18:18   ` Junio C Hamano
  2018-08-16 18:41     ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2018-08-16 18:18 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Shani Fridman, git@vger.kernel.org

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> On Thu, Aug 16, 2018 at 12:54 PM, Shani Fridman
> <Shani.Fridman@visionmap.com> 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-<.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: submodules : switching to an older commit/Tag in project with submodules
  2018-08-16 18:18   ` Junio C Hamano
@ 2018-08-16 18:41     ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 5+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2018-08-16 18:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Shani Fridman, git@vger.kernel.org


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

> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> On Thu, Aug 16, 2018 at 12:54 PM, Shani Fridman
>> <Shani.Fridman@visionmap.com> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-16 18:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-16 10:54 submodules : switching to an older commit/Tag in project with submodules Shani Fridman
2018-08-16 14:56 ` Stefan Beller
2018-08-16 18:13 ` Ævar Arnfjörð Bjarmason
2018-08-16 18:18   ` Junio C Hamano
2018-08-16 18:41     ` Ævar Arnfjörð Bjarmason

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).