Loosing my HEAD with Submodules #41213
Replies: 2 comments
-
not sure whether this will help |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
In simple terms I would like to create a Parent/Child repository where the Child is a submodule and its branch should track that of its parent.
I have been trying to get this working and thought I understood what I was doing havinf read the docs and various posts but clearly I am missing something.
All seems to be setup correctly in config files until I switch branches 'main -> uat-> main' and I end up with submodule still in uat and if changes are committed to it, it looses its HEAD.
To keep things as simple as possible I would like to get this to working locally first.
git version 2.38.1.windows.1
Here are my Powershell steps
I can use
git submodule foreach git switch <branch>
to manually switch all submodules but I though the whole point of--recursive-submodules
together with config settingswas to automate this
In fact I was of the understanding that git config submodule.recurse true should mean
--recurse-submodules
was implied for all operations that support it, except clone, and that git config push.recurseSubmodules on-demand would ensure warning on attempts to commit a parent having changes in submodules.Beta Was this translation helpful? Give feedback.
All reactions