bitbucket stripped git revisions

心不动则不痛 提交于 2019-12-03 12:36:31

问题


After pushing to bitbucket my collegues commits are deleted and a message appears on bitbucket newsfeed

stripped 6f9de58aa748 from projektA
4 hours ago
stripped 54dae89de600 from projektA
4 hours ago
stripped e04022989a9d from projektA
...

How can I rescue the commits? Is Git really a versioning system that allows to delete commits? Is this due to --force ?


回答1:


How can I rescue the commits?

Unfortunately there is nothing you can do on your site to get these commits back (details). You need to contact the BB service team since only they can restore these commits.

Is Git really a versioning system that allows to delete commits?

When you configure it so. You have to set receive.denyNonFastForwards to true to disable this behavior in the repository on the server (which is the default when git init was run with the --shared option, but is false otherwise).

Is this due to --force ?

Yes, using the force parameter on git push does make the server side git to disable the safety check if your new branch head throws away other commits, and receive.denyNonFastForwards is false.




回答2:


In case anyone else finds this thread searching frantically for "bitbucket stripped commits" as I was:

I managed to restore mine locally by following these instructions.

I then pushed to bitbucket again and the stripped commits were restored.




回答3:


We also faced this recently. Quite annoying, I must say. But in our case, the stripped commits were restored immediately after the original user pushed again. The other thing that we did to avoid this from happening again was to disable "History Re-writes" on the branch in question.

Hope this helps someone who faces this in future!



来源:https://stackoverflow.com/questions/9481346/bitbucket-stripped-git-revisions

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