1

I have a git repo that contains 2 submodules. I want to create a new branch of the main app and have the submodules to point to a different "branch." I quote branch for I understand that submodules don't point to branches, but rather commit. I don't want the branch option for I don't always want the latest commit from the subs. I can't find in documentation. All three

taraloca
  • 9,077
  • 9
  • 44
  • 77

1 Answers1

0

You simply create a new branch in your main parent repo and then:

  • go in each submodules
  • checkout for each the right branch you want
  • go back in the parent repo and add and commit: that will record the gitlink (special entry in the index) of the two submodules new SHA1.

Since you have not configured the submodules to follow a branch, they will stay at the SHA1 you checked out for each of them.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250