You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I've had a project on BitBucket for many years, and this project, only I had access to and maintained.
In this project there is a file that has existed for years that contains information about an access token for an API, but now there will be a few more people who will help me maintain this project, and I want to remove this file from all history, to not allow these other people access to the API token.
How do I remove this file completely from the history, so that it is impossible to recover any information?
I even considered creating a new project with a copy of the current project, but with that I'll lose all the history of updates that were made.
Hello @ThePokyWizard ,
Thank you for reaching out to Atlassian Community!
In order to remove the file containing the sensitive data you have to rewrite the history, and there are two different methods/tools that help you remove the sensitive information from your repository's commit history :
I would personally recommend using BFG Repo-cleaner as I think it's easier to use and provide you with the option to instead of deleting the sensitive file, just replace the sensitive string with another one.
Both of the methods are detailed step-by-step in the documentation below, which although is for Bitbucket Server, also applies to Bitbucket Cloud, as it's pretty much standard git commands:
In that KB you can expand the section of each of the methods to be provided with detailed instructions for each of them. You can follow those instructions and let us know in case you run into any issues.
Hope that helps! If you have any questions, feel free to ask!
Thank you, @ThePokyWizard