J'ai trois référentiels: A, B et C.GIT sous submodule comportement étrange
Dans mon dépôt A, je créé un sous-module vers B (A/bibliothèque/B).
Dans mon référentiel B, j'ai créé un sous-module vers C (A/library/B/library/C).
Je veux créer une nouvelle branche sur mon dépôt C:
git clone --recursive C
cd C
git checkout -b branch-test
git touch test
git add test
git commit -m "test"
git push origin branch-test
Maintenant, je veux créer une branche sur mon dépôt B et que ma nouvelle branche, le sous-module vers C suit la branche I précédemment créé:
git clone --recursive B
cd B
git checkout -b branch-test
cd library/C
git checkout branch-test
cd ../../
git add library/C
git commit -m "Updating version of submodule C"
git push origin branch-test
Jusqu'à là, pas de problème. Le problème apparaît quand je fais la même chose sur mon dépôt A:
git clone --recursive A
cd A
git checkout -b branch-test
cd library/B
git checkout branch-test
Maintenant, quand je vais à A/bibliothèque/B et type I « branche git », je vois que je suis sur la branche " branche-test "de mon sous-module B. Mais quand je vais à A/bibliothèque/B/bibliothèque/C et je tape" branche git ", je peux voir que je suis sur un commit détaché et pas sur la branche" branche " -tester".
Savez-vous pourquoi?
Cordialement, Ben