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 for the same reason so I won’t have to keep extraneous file in working directory?
.git/config :
[submodule "path/to/repo"]
url = git@github.com:username/repo.git
.gitmodules
[submodule "path/to/repo"]
path = path/to/repo
url = git@github.com:username/repo.git
Are these basically the same things?
Same answer than
.git/info/excludeand.gitignore.The
.gitmodulesfile 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).