Bitbucket子模块不会删除 [英] Bitbucket submodules wont delete
问题描述
我意外地将一对文件夹推送到bitbucket中,该文件夹中包含.git文件夹,因为我使用git clone克隆了它们。
我无法点击这些文件夹或在bitbucket中进入它们
我该如何摆脱我已经使用过的那些:
rm -rf .git
这两个.git文件夹
然后:
git reset --hard ^ HEAD
git push
git commit -a -mMessage
git push
我也尝试将提交设置回一个,但那也不起作用。
没有这些子模块文件我也从那里移动目录的文件夹,并再次推动,但他们仍然apear。
这些不是你在.buit网站上看到的.git文件夹。 这些是 submodules 。
删除 .git
并推送不会改变它,因为:
- 您的主要仓库的
.gitmodules
仍然会声明所述子模块 - 该索引仍包含特殊条目(gitlink,模式160000)
要删除子模块,请参阅如何删除Git子模块? (git 1.8.5 +):
git submodule deinit asubmodule
git rm asubmodule
#注意:asubmodule(无尾随斜线)
#或者,如果你想把它留在工作树中
git rm --cached asubmodule
然后提交并推送。
I accidentally pushed a couple folders to bitbucket that had .git folders in them because I cloned them using git clone.
I can't click these folders or go into them in bitbucket
what do I do to get rid of those I already used:
rm -rf .git
for those two .git folders then:
git reset --hard ^HEAD
git push
git commit -a -m "Message"
git push
I also have tried setting the commit back one but that didn't work either. there are no submodule files for these I've also moved the folders from there directory and made another push yet they still apear.
Those are not "folders with .git" you see on the bitbucket site.
Those are submodules.
And removing the .git
and pushing won't change that, since:
- the
.gitmodules
of your main repo still does declare said submodules - the index still contain a special entry (gitlink, mode 160000)
To remove a submodule, see "How do I remove a Git submodule?" (git 1.8.5+):
git submodule deinit asubmodule
git rm asubmodule
# Note: asubmodule (no trailing slash)
# or, if you want to leave it in your working tree
git rm --cached asubmodule
Then commit and push.
这篇关于Bitbucket子模块不会删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!