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

Aperta
#2,060 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
55/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
git
Ambito
documentation

Direzione di ricerca

Find the Publishing Submodule Changes section and read its guidance for git push --recurse-submodules=on-demand. Verify the reported behavior when the superproject branch is main and the submodule branch is master; done means the section briefly explains this limitation and prevents the confusing failure described in the issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
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

Lingua principale
CSS
Stelle
6.6k
Fork
2.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di progit/progit2

Tutte le issue di progit/progit2

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.