Completely remove commit from Bitbucket history

I made the wrong commit and sent it to my personal bitbucket.org repository. How can I completely remove this commit from the history of the remote repository?

I tried the following:

git reset --hard HEAD~1 git reset HEAD~ git commit -m "some message" git push -f 

I did this based on a solution from Bitbucket git reset

However, previous commits are available through the Bitbucket web interface.
I mean, they are still accessible by reference, for example https://bitbucket.org/user/repo/commits/<deleted commit hash> (although they are not listed in the repository commits in the web interface).

Was this information (history that I intended to delete) received from my repository?

Or

  1. Is this some bitbucket.org feature?
  2. Did I take some steps wrong? Which the?
  3. How to completely remove a commit from history on bitbucket.org?
+6
source share
1 answer

You can achieve this by resetting the commit and forcibly pushing the updated branch to your remote. Note: be careful if other persons have a check in the branch.

Suppose your story is similar to the following and you want to remove commit 200 :

 commit 300 commit 200 commit 100 

Follow these steps:

git rebase -i HEAD~3

Now remove the commit 200 line.

Save the file, and then forcibly click on the branch on the remote control:

 git push -f origin <branch_name> 
0
source

Source: https://habr.com/ru/post/1202699/


All Articles