'Trigger automatic pull/push for submodule after new commit appear

I have a project A and I have added a submodule to another project B.

I see that the submodule used in A is referring to a particular commit, and I would like this to be updated every time a new commit appears in B.

Is it possible to trigger an automatic pull/push of the submodule in A when B is updated?
Or this procedure has to be done always by hand?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source