Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Mention the issue when the branch names of the submodules and superproject differ #2060

Copy link
Copy link
@Fingerling42

Description

@Fingerling42
Issue body actions

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' failed

In 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

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.