0

So I have repo A and inside this repo I have repo B as a submodule. Whenever I clone my repo A from github it always comes with whatever was the head of repo B when I made the project. Is there a way to make it so that when I clone repo A it always comes with the latest repo B in the submodule? This was my entire purpose of learning about submodules (i am new to all of this) was to always have that repo have the latest submodule...

With the current behavior I could have just made it include a hard copy of the repo since I still have to go in and do manual updates.

Eddiea6987
  • 31
  • 6
  • "*Whenever I clone my repo A … it always comes with whatever was the head of repo B when I made the project.*" This is how submodules work; see https://stackoverflow.com/q/5033441/7976758 ; this guarantee that the code in the superproject is compatible with the code in the submodule(s). – phd Feb 16 '22 at 07:19
  • To have the gitlink points to the latest commit [update](https://stackoverflow.com/search?q=%5Bgit-submodules%5D+update) the submodule(s) and commit the update in the superproject. That's the only way. – phd Feb 16 '22 at 07:20
  • @phd yeah that's the usually route I have taken just manually updating , I just wish every time someone cloned my repo they would have the latest version of the submodules. Oh well. – Eddiea6987 Feb 18 '22 at 01:16
  • "*I just wish every time someone cloned my repo they would have the latest version of the submodules.*" No way, sorry. – phd Feb 18 '22 at 11:55

0 Answers0