submodules : switching to an older commit/Tag in project with submodules
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:[email protected] 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:[email protected] and completely delete or destroy any and all electronic or other copies of the original message and any attachments thereof.
Quoted 10 lines · Shani Fridman
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
Quoted 9 lines · Shani Fridman
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".
Quoted 5 lines · Ævar Arnfjörð Bjarmason
Quoted 3 lines · Shani Fridman
Hi everybody,
Quoted 8 lines
Quoted 6 lines
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-<.
Quoted 12 lines · Junio C Hamano
Quoted 10 lines · Ævar Arnfjörð Bjarmason
Quoted 8 lines · Shani Fridman
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.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
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.