0

I have a branch main with another branch child in repo which is also a submodule of branch main.

main
- somefile
- somefolder
- child (S)
   -somefile

If I make changes to child submodule folder while working on main branch. How would i commit and push changes to child branch ?

user3508453
  • 878
  • 3
  • 14
  • 24
  • A branch cannot be a submodule. Can you please use correct terminology? In the current form the question is not clear. – phd Nov 26 '18 at 22:20
  • Yes it can. `git submodule add -b branchname...` – user3508453 Nov 27 '18 at 05:41
  • This means that the superproject **tracks the branch** of the submodule (instead of just tracking a commit). It doesn't mean the branch **is** a submodule. – phd Nov 27 '18 at 09:53
  • And the answer that you're looking for is probably this: https://stackoverflow.com/a/1811738/7976758. I.e., first you `cd` into the `child`, add, commit and push, then you `cd` back to the superproject, add, commit and push. – phd Nov 27 '18 at 09:57

0 Answers0