如何删除Bitbucket中的所有提交

Laz*_*h13 1 git bitbucket

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

yam*_*tes 6

我不知道为什么你想做这样的事情,但..

一种方法是重置为初始提交:

git reset --hard (find the sha1 of your first commit)
Run Code Online (Sandbox Code Playgroud)

然后强制推动:

git push -f
Run Code Online (Sandbox Code Playgroud)

你几乎要重写你所推动的任何分支的整个历史.为什么不创建一个新的存储库?