Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
几天前,我使用了 git 的子模块功能并添加了很多存储库,但是我现在将它们全部删除(git submodule list不返回任何内容;而且,.git/config相关.gitmodules不包含任何存储库信息)。但是 git确实保留了它们:它们仍然在目录的.git/modules目录中!让我烦恼的是,即使我根本不需要它们,它们也会占用磁盘空间(而且我相信我可以随时将它们重新添加为子模块)。
git submodule list
.git/config
.gitmodules
.git/modules
那么我该如何处理呢?我可以简单地删除目录.git/modules吗?
是的,你可以rm -rf .git/modules/XXX。
rm -rf .git/modules/XXX