3

Is there a Git command to force a specific submodule/main module relationship or do I have to manually edit a file in the .git directory?

For example, my main program uses a library common to many projects, but I need to have a particular commit in the library tied to my main program.

I.e., I have been using submodules naively and the relationships are messed up, and I want to fix them.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Walt Howard
  • 7,676
  • 1
  • 16
  • 11

1 Answers1

1

By definition, a submodule is a way to record a specific SHA1 as a gitlink entry in the index of the parent repository.

If somehow the submodule doesn't reflect the right SHA1, all you have to do is checkout the appropriate SHA1, go back to the parent repo, add and commit: that will record the new desired state of the submodule.

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