1

If I have a git project Consumer with a git submodule repo called Producer, is there any way to keep the commit history from the submodule (Producer) seperate from the containing git repo (Consumer)?

cowboydan
  • 1,062
  • 7
  • 15

1 Answers1

1

By definition, a submodule allows you to keep it separate from its parent repo.

Consumer would record a gitlink (special entry in its index) to Producer, that is a fixed SHA1.

Even if you instruct that submodule to "follow" a branch, a checkout of Consumer will not immediately update Producer (a separate git submodule update --remote is needed)

A submodule is there to allow a repo to reference another repo at a fixed point in the submodule repo history (see "true nature of submodules")

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