0

I have a submodule, let's call it my-submodule. And two projects that use this submodule: project-accounts/ project-proxy.

What I did.

  • In project-accounts I created new branch feature-1 from remote develop branch for my-submodule. Did commit commit-1 and pushed to this new branch (submodule).
  • In project-accounts (in main project) I also create new branch, did some changes, then commit commit-2 and push. In changes I can see that shared module now links to the new commits (hash was 1234567, now 7654321 - aka commit-1). Subproject commit appeared.
  • In project-proxy I ran git submodule update --recursive. Then did git pull origin feature-1. Changes appeared. Now I want to make it so that this project also links to new commit in submodule. But when I perform commit git doesnt see any changes, so no subproject commit available.

How to fix it?

phd
  • 82,685
  • 13
  • 120
  • 165
funnelCONN
  • 149
  • 1
  • 11
  • How about [this](https://stackoverflow.com/a/19029685/8564999) – Alexey S. Larionov Jul 06 '21 at 12:11
  • 1
    Better, this: https://stackoverflow.com/a/1032653/7976758 `git submodule update --recursive --remote` – phd Jul 06 '21 at 12:30
  • @phd Can I choose remote branch with this command? – funnelCONN Jul 06 '21 at 13:03
  • See [`git submodule update`](https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-update--init--remote-N--no-fetch--no-recommend-shallow-f--force--checkout--rebase--merge--referenceltrepositorygt--depthltdepthgt--recursive--jobsltngt--no-single-branch--ltpathgt82308203) and [`git submodule set-branch`](https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-set-branch-b--branchltbranchgt--ltpathgt). – phd Jul 06 '21 at 14:08

0 Answers0