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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

22,452 views 26 12
Join discussion

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