[英]How do I remove a submodule from my github repository?
I happened to change a name of a directory within my local repository and then proceeded to push this change up to my github repository. 我碰巧在本地存储库中更改了目录名称,然后继续将此更改推送到我的github存储库中。 In effect, it caused this repository to turn into a git submodule which is displayed as a green icon on github and there is no way to drill down further in to the directory to view individual files.
实际上,它导致该存储库变成git子模块,该子模块在github上显示为绿色图标,并且无法进一步深入查看该目录以查看单个文件。
How do I remove the submodule from github? 如何从github删除子模块?
Remove the directory as file. 删除目录作为文件。
git rm --cached path/to/directory
Note that you don't use a trailing slash. 请注意,您不要使用斜杠。 This will delete the special file that point to the commmit in the subrepository.
这将删除指向子存储库中提交的特殊文件。
Remove the .git folder inside the /path/to/directory before re-adding the directory into the index. 在将目录重新添加到索引之前,请删除/ path / to /目录中的.git文件夹。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.