DEV Community

Discussion on: How to Remove Secrets From a Git Repository

Collapse
 
highperformancecoder profile image
Russell Standish

Why not treat a commit of secrets as like a password leak? Update .gitignore and change the affected password so that the leaked secrets are no longer relevant.

Collapse
 
arthvhanesa profile image
Arth Vhanesa

Yes, We can do it as you've suggested.

But why not remove it entirely from the repo if we can? It makes commit history cleaner as nothing from .gitignore is available in the previous commits as well.