0

In our git project we have one submodule. This submodule is configured in submodules file with a specific branch. So if we init or update the submodule, we always use the --remote Option.

But now, every time we update the submodule, there are changes in metadata of the submodule (subproject commit). The hash changes.

Is it possible to deactivate this change and just use the branch specified in gitmodules? In our case the commit hash is obsolete.

kowsky
  • 12,647
  • 2
  • 28
  • 41
  • Possible duplicate of [Git submodules: Specify a branch/tag](https://stackoverflow.com/questions/1777854/git-submodules-specify-a-branch-tag) – phd Oct 09 '18 at 16:00
  • https://stackoverflow.com/search?q=%5Bgit-submodules%5D+track+branch – phd Oct 09 '18 at 16:00
  • 1
    My Problem is That i dont want to commit The sha1 of The submodule. Is it possible to just use The branch in gitmodules? – Dominik Notzon Oct 09 '18 at 16:21
  • No. You always track a commit (by its id). By using the `--remote` option, the tracked id gets updated to the specified branches' current head, but you still have to commit the ID change in the main repository. – kowsky Oct 10 '18 at 08:07
  • @kowsky thank you! – Dominik Notzon Oct 15 '18 at 08:28

0 Answers0