Created
November 18, 2016 20:19
-
-
Save w0rd-driven/60779ad557d9fd86331734f01c0f69f0 to your computer and use it in GitHub Desktop.
BFG Repo-Cleaner --replace-text example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PASSWORD1 # Replace literal string 'PASSWORD1' with '***REMOVED***' (default) | |
PASSWORD2==>examplePass # replace with 'examplePass' instead | |
PASSWORD3==> # replace with the empty string | |
regex:password=\w+==>password= # Replace, using a regex | |
regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines |
@yamunaarumugam If you have this exact situation (Password: "something") and you want it to be removed, the following regular expression should work. But use an online regex tester to check if it works first
regex:(?<=Password: ")[^"]*==>REMOVED
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, is there a way to search like "PASSWORD1".
Consider commit history with the following line:
password: "PASSWORD1"
When I replace the commit history, the above line becomes,
password: "REMOVED"
Again I'm getting secrets detected in repository.
Please provide your suggestions.
Thanks in advance!