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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,976 views 1 5
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