清除Bitbucket上的git存储库? [英] Clear git repository on Bitbucket?

查看:77
本文介绍了清除Bitbucket上的git存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用git,并开始与Bitbucket混淆。但是,我现在要使用我创建的存储库,但没有其最初的历史记录。



有什么方法可以清除或清除我的存储库,以便可以启动从头开始?



我不太在意任何内容,所以我可以删除存储库,然后创建一个具有相同名称的新存储库?

解决方案

不需要删除它。 p

简单地说:

  git push --force -u原始大师
$ b $

这将用您在本地完成的新分支替换BitBucket主分支的历史记录。

现在,如果您以前推过其他分支,则可能需要删除它们

  git push origin:oldBranch 


I'm just getting started with git, and started messing about with Bitbucket. However, I now want to use the repository I created, but without its initial history.

Is there any way I can clear out or purge my repository so that I can start from scratch?

I'm not too bothered about any of the content, so can I just delete the repository, then create a new one with the same name?

解决方案

No need to delete it.

From your new local repo, simply:

 git push --force -u origin master

That will replace the history of your BitBucket master branch by the new one you have done locally.

Now, if you had pushed other branches before, you might want to delete them.

git push origin :oldBranch

这篇关于清除Bitbucket上的git存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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