Skip to content
Open
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: 4 additions & 0 deletions book/07-git-tools/sections/submodules.asc
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@ As you can see there, Git went into the `DbConnector` module and pushed it befor
If that submodule push fails for some reason, the main project push will also fail.
You can make this behavior the default by doing `git config push.recurseSubmodules on-demand`.

If you're pushing `main` but the submodule changes are on `master`, the recursive push can fail with `src refspec 'main' must name a ref` in the submodule.
For example, if `DbConnector` has no local `main` branch, push its branch explicitly with `git -C DbConnector push origin master`.
Then run `git push --recurse-submodules=check origin main` from the main project to verify the submodule commit is available before publishing the branch that refers to it.

===== Merging Submodule Changes

If you change a submodule reference at the same time as someone else, you may run into some problems.
Expand Down