Permanently delete file from history, edit previous commits

Unfortunately, I've previously pushed files into my BitBucket Mercurial repo that included some sensitive information (e.g. passwords).  I want to deal with this in two ways:

  • There are some files which I want to delete permanently from my Mercurial history
  • There are some files where I want to edit the revisions directly.  I do not want to delete these revisions because I want to keep a history of these revisions.

I am not worried about "other" users because this is a private repository and I am the only user/committer.  How do I do something like this?  I want to keep my current BitBucket Mercurial repo because I have a bunch of issues created, etc.

If I have to delete the repo, is the repo really deleted on a permanent basis?  Does BitBucket/Atlassian keep old copies of my repo in some sort of backup somewhere, etc.?

3 answers

We always recommend that, if sensitive data such as passwords or private keys are stored in a repository, that they be considered compromised and no longer usable. Please change your passwords.

Hi John, thanks for the answer.  I am definitely going to do what you suggest.

However, it still doesn't answer my original questions.  What do you suggest for my original concerns and questions?

What if the information that was exposed was personal information, rather than something that couldn't be changed like a password, so it needed to be somehow removed/hidden/blacked out from the history?


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

1,957 views 7 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you