简体   繁体   English

如何永久删除git存储库中的子模块?

[英]How to permantly remove submodules in git repository?

Several days before, I used the submodule feature of git and added quite a lot of repositories, however I remove all of them now( git submodule list returns nothing; also, .git/config and the related .gitmodules do not contain any of the repository information). 几天前,我使用了git的子模块功能,并添加了很多存储库,但是现在我删除了所有存储库( git submodule list返回任何内容;此外, .git/config和相关的.gitmodules不包含任何存储库信息)。 But git do preserve them: they are still in the directory of .git/modules directory! 但是git 确实保留了它们:它们仍然位于.git/modules目录中! What annoys me is that they take disk space even I don't need them at all(also I believe I could re-add them as submodule at any time). 令我烦恼的是,即使我根本不需要它们,它们也会占用磁盘空间(我也相信我可以随时将它们重新添加为子模块)。

So how can I deal with that? 那么我该如何处理呢? Can I simply remove the directory .git/modules ? 我可以简单地删除目录.git/modules吗?

是的,您可以rm -rf .git/modules/XXX

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM