I have fork of a repo as submodule and I have separated branch (that is pull request BTW) and I want my repo to use that feature branch as default for submodule so people that clone my repo will use that feature branch. How can I do this?
Asked
Active
Viewed 100 times
1 Answers
1
I don't think so: a submodule is there to record a specific commit to be reused.
Other users cloning your repo will update that submodule at that same commit SHA1 (in a detached HEAD mode), they won't see a branch.
This is what is explained in:
- "Git submodules: Specify a branch/tag".
- "how exactly does git submodule work"
- "How to make submodule with detached HEAD to be attached to actual HEAD?"
Once updated, a user can go into that submodule, checkout a branch and link it to a remote tracking branch of the corresponding remote repo for that submodule if he/she wants.
But once the modifications are done, that branch won't be part of the submodule information recorded by the parent repo.