-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
General overview of your idea.
The Publishing Submodule Changes section describes how to use the git push --recurse-submodules=on-demand command, which should push the submodules changes first, then the main project changes.
However, as of Git v2.51.2, it will not work if the names of the superproject and submodules branches are different. The error is something like this:
fatal: src refspec 'refs/heads/main' must name a ref
fatal: process for submodule 'simple_git_project' failedIn this case, the superproject branch was called main, and the submodule branch was called master.
I don't know what Git maintainers think about it, but the problem is quite old (here's a mention on Stack Overflow).
It might be helpful to add a short note clarifying that in Pro Git.
What problem will this solve?
This will save the reader from two hours of confusion when a command fails for a not-so-obvious reason.
Have you thought about other solutions?
No response
Do you want to help with this enhancement idea?
Maybe