How to delete all commits in Bitbucket [duplicate]

烈酒焚心 提交于 2019-12-04 19:08:21

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

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

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

and then force push:

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?

git reset --hard <commit>

Read more here: https://www.atlassian.com/git/tutorial/undoing-changes#!reset

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!