Removal of sensitive data from previous commits

raghavan21_2000
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 3, 2024

Hello everyone, I need help to remove sensitive info which is been committed in a repo. I've removed those credentials in the latest commit, but still, in previous commit histories I can view it, can anyone suggest how can I remove the same? (If it's possible to remove)


1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 5, 2024

Hi @raghavan21_2000 and welcome to the community!

You can use BFG repo cleaner to rewrite history in older commits and remove sensitive info.

This is the website of the BFG tool:

You can also check the following reply in a StackOverflow post that was made by the author of BFG:

Before you use this tool, please ensure you take a backup of your repo in case anything goes wrong.

After you make changes with BFG, I would also suggest pushing first to another newly created empty repo so you can inspect if the changes look ok (you can delete this extra repo afterwards if you no longer need it). If everything looks ok, then push to your existing repo.

When you push to your existing repo, please let me know and I can run a garbage collection in order to remove the dangling commits from the remote repo.

Please feel free to reach out if you have any questions.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events