checkout icon indicating copy to clipboard operation
checkout copied to clipboard

Git submodules 'remote' option

Open iliyanpetrov-sag opened this issue 4 years ago • 4 comments

Hi Experts,

I would like to request an additional option that will add the parameter --remote to the "git submodule update" command. This parameter is really important because it will get the latest commit coming from the git submodule. If it is missing then the there is a big chance the git submodule to be checked out in detached HEAD different than the latest commit.

Best Regards, Iliyan Petrov

iliyanpetrov-sag avatar Dec 02 '21 14:12 iliyanpetrov-sag

Hi there... I may have an issue related to this one. I have a repository from which I have forked (https://github.com/OpenModelica/OpenModelica.git). My fork is https://github.com/jdpipe/OpenModelica.git. This repository uses various submodules, one of which I wanted to fork and then modify. My forked submodule is https://github.com/jdpipe/OMCompiler-3rdParty.git. I have updated the gitmodules file to point to this new submodule.

Here's the problem though... when I attempt to check out my forked copy of the OpenModelica repository, it is failing to pick up my settings for the submodule OMCompiler-3rdParty, and is picking up OpenModelica/OMCompiler-3rdParty instead of my jdpipe/OMCompiler-3rdParty.

I think there could be a bug in the actions/checkout code. Perhaps it is not good at getting submodules in nested subdirectories (this submodule lives in OMCompiler/3rdParty, not at the top level). Or perhaps it is struggling becuase I referenced the submodule using ssh instead of https. Or perhaps as Ilyan suggests, it some issue with not fetching the latest commit???

Not sure if you can access this output, but the results of my actions/checkout effort are here: https://github.com/jdpipe/OpenModelica/runs/4416183797

jdpipe avatar Dec 04 '21 08:12 jdpipe

We would love to have that feature too. We are building a website consisting of multiple submodules where we would need to fetch the newest version of the submodule

Dr-Electron avatar Apr 14 '22 11:04 Dr-Electron

Would also like to see this feature.

ImpossibleShape avatar Nov 13 '23 14:11 ImpossibleShape

It would be also very helpful for GitHub actions that run e.g. daily to track if everything still builds and runs with upstream changes in submodules.

koalo avatar May 08 '24 08:05 koalo