A simple bash script to remove git files history which contains sensitive data like secrets, keys, passwords. Once you got here, you've failed on it like me. 😂
- You must have git client installed.
- Windows users:
- GitBash installed together with your git client.
- Unix based users:
- Just run it at your terminal.
- Copy the script to the repository folder you want to get the script working.
- Grant execute permission (only for Unix)
$ chmod +x ./filter-repo
Run the script
$ ./filter-repo <files-collection-path>
Each line must provide a relative file path followed by the secrets which must be replaced, split by an empty space.
Format
<file-name> [secrets]
Example
conf/appsettings.json mysupersecuresecret
conf/config.js mysupersecuresecret anothersupersecuresecret