I have git repository where I have several submodules. I have fetched latest commit in main git repo. But If I type git checkout origin/master then I got error because of changes in submodules that should be commited first. In main repo git status shows that there are changes in submodules. But git status in each submodule shows no changes. When Issue git diff some_submodule from main repo there are changes which only shows changing of commit ID:
diff --git a/some_submoduleb/some_submodule
index 21c00cb..2392944 160000
--- a/some_submodule
+++ b/some_submodule
@@ -1 +1 @@
-Subproject commit 21c00cb4729feacd95a9ea01d100a2e0f2ddb604
+Subproject commit 2392944290df7d41ad3abfe50f71e5c3886de798
Why is this happening and how can checkout origin/master in main repo?
Config:
You could try this.
git submodule update
If you're using Visual Studio, right-click in the Git Changes window and select Submodule Update.

Git Submodules: https://git-scm.com/book/en/v2/Git-Tools-Submodules
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With