0

When I issue git submodule add will submodule be added from the master?

If yes - how do I tell git to use particular release (latest one)?

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
Igor
  • 5,620
  • 11
  • 51
  • 103
  • Submodules have very little use for branch names. The `git submodule update --remote` that is in VonC's answer one of the little uses, but given how poor submodule support is in Git, I recommend learning how to manipulate the submodules directly. – torek Jan 17 '22 at 13:22

1 Answers1

0

It will add the latest commit of the default remote submodule repository default branch.

If the default branch is master, then the submodule will reference the latest commit of that branch at the time of the git submodule add.

You need to check if that particular commit is indeed the "latest release" you want.

You can also ocnfigure a submodule to follow a particular branch; only on demand though, when you do a git submodule update --remote.

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