如何删除Bitbucket中的所有提交 [英] How to delete all commits in Bitbucket

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

问题描述

我想恢复存储库中的所有更改,因此是否可以删除Bitbucket中的所有提交?如果是这样,怎么样?

I want to revert all my changes in a repository, so is it possible to delete all commits in Bitbucket? If so, how?

推荐答案

我不知道你为什么要这样做,但是..

I have no idea why you'd want to do something like this, but..

p>

执行此操作的一种方法是重置为您的初始提交:

One way to do it would be to reset to your initial commit:

git reset --hard (find the sha1 of your first commit)

然后强制推送:

git push -f

你几乎重写了你推向的任何分支的整个历史。为什么不创建一个新的存储库?

You're pretty much rewriting the entire history of whatever branch you're pushing to. Why not just create a new repository?

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

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