difference between .gitmodules and specifying submodules in .git/config?

前端 未结 2 773
轮回少年
轮回少年 2021-02-02 08:20

Probably very silly question, - but I\'ve been specifying submodules up until now in .gitmodules file. It recently struck me that perhaps it\'s possible to just use .git/config

相关标签:
2条回答
  • 2021-02-02 08:37

    Same answer than .git/info/exclude and .gitignore.

    The .gitmodules file can be included in the repository and shared with everyone (that is, it can be added and committed like any regular file), whereas anything in .git (like .git/config) is private (you cannot add it in the repository).

    0 讨论(0)
  • 2021-02-02 08:56

    The git submodule sync will update your config file with the details from the .gitmodules file, so the latter should be considered the 'master' - it's passed between repos as stated by @Artefact2.

    This is useful when submodule URLs change upstream and you need to update your local repositories accordingly.

    0 讨论(0)
提交回复
热议问题