从github中删除子项目提交 [英] Removing subproject commit from github

查看:151
本文介绍了从github中删除子项目提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个存储库,即 A B 。我错误地在我的机器上克隆了A里面的repo B.我从repo B中删除了所有代码,但是当我从源代码中推送并合并代码时,它还在Github repo上显示了一个子项目commit B



我想在原点上从我的主文件中删除子项目提交。这些步骤是否有效?

1。 rmdir B(在我的本地仓库A)
2.将我的仓库A推到原产地
3.合并

解决方案

由于GitHub在A repo中显示B作为灰色文件夹,这意味着B已作为子模块添加到A中。

该灰色文件夹是 < gitlink 特殊条目。



请参阅我如何删除Git子模块?

在本地,执行 git submodule deinit asubmodule git rm B B 没有任何结尾斜杠 B / )。

然后按到GitHub,并且 B 应该消失。


I have two repositories namely A and B. By mistake I cloned repo B inside A on my machine. I removed all the code from the repo B but when I pushed and merged my code from A on origin, it also shows a subproject commit B on Github repo.

I want to remove the subproject commit from my master on origin. Will these steps work?

1. rmdir B (on my local repo A) 2. Pushing my repo A to origin 3. Merging

解决方案

Since GitHub displays B as a gray folder within A repo, that means B has been added to A as a submodule.
That gray folder is a gitlink, a special entry in the index.

See "How do I remove a Git submodule?":
Locally, do git submodule deinit asubmodule and git rm B (B without any trailing slash B/).
Then push to GitHub, and B should be gone.

这篇关于从github中删除子项目提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆