Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BFG Repo-Cleaner --replace-text example
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
@mevers303

This comment has been minimized.

Copy link

mevers303 commented May 10, 2018

Thanks!

@BarbzYHOOL

This comment has been minimized.

Copy link

BarbzYHOOL commented Sep 29, 2018

Very useful.

regex:(?i)(barbz)==> # Matches "barbz" insensitively

@fcu423

This comment has been minimized.

Copy link

fcu423 commented Dec 18, 2018

Hi!

Do you know if there's anyway to use the BFG command to delete files but applying it only to an specific path in the repository?

Several files might match the regex expressions that I'm building but I would like to filter so that it only applies to the files I want.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.