Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions book/07-git-tools/sections/submodules.asc
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ Submodule DbConnector c3f01dc..c87d55d:
> better connection routine
----

Git will by default try to update *all* of your submodules when you run `git submodule update --remote`.
Git will by default try to update *all* of your submodules when you run `git submodule update --remote`.
If you have a lot of them, you may want to pass the name of just the submodule you want to try to update.

===== Pulling Upstream Changes from the Project Remote
Expand Down Expand Up @@ -969,7 +969,7 @@ nothing to commit, working tree clean
----

Using the `--recurse-submodules` flag of `git checkout` can also be useful when you work on several branches in the superproject, each having your submodule pointing at different commits.
Indeed, if you switch between branches that record the submodule at different commits, upon executing `git status` the submodule will appear as ``modified'', and indicate ``new commits''.
Indeed, if you switch between branches that record the submodule at different commits, upon executing `git status` the submodule will appear as ``modified'', and indicate ``new commits''.
That is because the submodule state is by default not carried over when switching branches.

This can be really confusing, so it's a good idea to always `git checkout --recurse-submodules` when your project has submodules.
Expand Down