Reputation: 4653
This is a great article on submodules but I have a question I might be able to get answered here.
I have my repo/submodule here: home/submodule
and then I have it included as a submodule here: home/core/submodule
but if I go into home/submodule and make some changes, then to a git add, git commit, git push that is all fine.
but then if I go into home/core/submodule and do a git status it will say it is up to date, even though it is/should be 1 commit behind.
If I then stay in home/core/submodule and do a git pull, it will pull down the changes, even though it does not think there is any, and it will then be up to date with the remote.
Is there something I am doing wrong, or am I mis-using submodules?
related q Git submodule to track remote branch and Git submodules workflow
EDIT - good resource here https://git-scm.com/book/en/v2/Git-Tools-Submodules - particularily around git diff --submodule
to show the new commits in the submodule.
Upvotes: 0
Views: 48
Reputation: 34800
Git doesn't automatically check any remotes for new content. It only communicates with the remote when you do git fetch
or git pull
(or git push
).
If you first did git fetch
, it would have shown you that you are behind by X commits.
Upvotes: 2