.gitmodules和.git / config中指定子模块的区别? [英] difference between .gitmodules and specifying submodules in .git/config?
问题描述
可能非常愚蠢的问题,但我一直在.gitmodules文件中指定子模块。它最近让我感到可能只是使用.git / config出于同样的原因,所以我不必在工作目录中保留无关文件?
.git / config:
[submodulepath / to / repo]
url = git@github.com:username / repo.git
.gitmodules
[submodulepath / to / repo]
path = path / to / repo
url = git@github.com:username / repo.git
这些基本上是一样的吗? c $ c> .gitignore 。
.git
中的任何内容(如 .git / config
)是私有的(您不能将其添加到存储库中)。
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/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).
这篇关于.gitmodules和.git / config中指定子模块的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!