Bitbucket子模块不会删除 [英] Bitbucket submodules wont delete

查看:143
本文介绍了Bitbucket子模块不会删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意外地将一对文件夹推送到bitbucket中,该文件夹中包含.git文件夹,因为我使用git clone克隆了它们。

i.stack.imgur.com/PwJDY.jpgalt =

我无法点击这些文件夹或在bitbucket中进入它们



我该如何摆脱我已经使用过的那些:

  rm -rf .git 

这两个.git文件夹
然后:

  git reset --hard ^ HEAD 
git push
git commit -a -mMessage
git push

我也尝试将提交设置回一个,但那也不起作用。
没有这些子模块文件我也从那里移动目录的文件夹,并再次推动,但他们仍然apear。

div>

这些不是你在.buit网站上看​​到的.git文件夹。 这些是 submodules



删除 .git 并推送不会改变它,因为:





要删除子模块,请参阅如何删除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:

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屋!

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