Automatically Updating Submodules on Every Pull

Hello everyone,

I’m currently working on setting up a repository and I’ve encountered a situation that I need help with. I have a submodule in my repository which is a code library that is used across multiple repositories.

My goal is to ensure that every time a pull is made, regardless of the method (console, Visual Studio, etc.), the submodules also should get updated to the newest head of the main branch. This should happen even when there are only changes in the submodule and not in the main repository.

Does anyone have experience with this or can provide some guidance on how to achieve this? Any help would be greatly appreciated.

Thank you in advance!