rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
11.12k stars 548 forks source link

Add reference of command line options #117

Open sschuberth opened 9 years ago

sschuberth commented 9 years ago

Can we get a reference of all supported command line options and their meaning added to the README or web site? If you do not have BFG installed yet and want to check for a particular feature, it otherwise is quite cumbersome to find out.

javabrett commented 9 years ago

Here's the current (1.12.5) usage for anyone coming across this thread. These could be added to README.md and a pull-request made, but it's probably a bit wordy for that file, with the website being a better option.

bfg 1.12.5
Usage: bfg [options] [<repo>]

  -b <size> | --strip-blobs-bigger-than <size>
        strip blobs bigger than X (eg '128K', '1M', etc)
  -B NUM | --strip-biggest-blobs NUM
        strip the top NUM biggest blobs
  -bi <blob-ids-file> | --strip-blobs-with-ids <blob-ids-file>
        strip blobs with the specified Git object ids
  -D <glob> | --delete-files <glob>
        delete files with the specified names (eg '*.class', '*.{txt,log}' - matches on file name, not path within repo)
  --delete-folders <glob>
        delete folders with the specified names (eg '.svn', '*-tmp' - matches on folder name, not path within repo)
  -rt <expressions-file> | --replace-text <expressions-file>
        filter content of files, replacing matched text. Match expressions should be listed in the file, one expression per line - by default, each expression is treated as a literal, but 'regex:' & 'glob:' prefixes are supported, with '==>' to specify a replacement string other than the default of '***REMOVED***'.
  -fi <glob> | --filter-content-including <glob>
        do file-content filtering on files that match the specified expression (eg '*.{txt,properties}')
  -fe <glob> | --filter-content-excluding <glob>
        don't do file-content filtering on files that match the specified expression (eg '*.{xml,pdf}')
  -fs <size> | --filter-content-size-threshold <size>
        only do file-content filtering on files smaller than <size> (default is 1048576 bytes)
  -p <refs> | --protect-blobs-from <refs>
        protect blobs that appear in the most recent versions of the specified refs (default is 'HEAD')
  --no-blob-protection
        allow the BFG to modify even your *latest* commit. Not recommended: you should have already ensured your latest commit is clean.
  --private
        treat this repo-rewrite as removing private data (for example: omit old commit ids from commit messages)
  --massive-non-file-objects-sized-up-to <size>
        increase memory usage to handle over-size Commits, Tags, and Trees that are up to X in size (eg '10M')
  --fix-filename-duplicates-preferring <filemode>
        Fix corrupt trees which contain multiple entries with the same filename, favouring the 'tree' or 'blob'
  <repo>
        file path for Git repository to clean
halt9k commented 1 year ago

Current bfg 1.14.0 output:

bfg 1.14.0
Usage: bfg [options] [<repo>]

  -b, --strip-blobs-bigger-than <size>
                           strip blobs bigger than X (eg '128K', '1M', etc)
  -B, --strip-biggest-blobs NUM
                           strip the top NUM biggest blobs
  -bi, --strip-blobs-with-ids <blob-ids-file>
                           strip blobs with the specified Git object ids
  -D, --delete-files <glob>
                           delete files with the specified names (eg '*.class', '*.{txt,log}' - matches on file name, not path within repo)
  --delete-folders <glob>  delete folders with the specified names (eg '.svn', '*-tmp' - matches on folder name, not path within repo)
  --convert-to-git-lfs <value>
                           extract files with the specified names (eg '*.zip' or '*.mp4') into Git LFS
  -rt, --replace-text <expressions-file>
                           filter content of files, replacing matched text. Match expressions should be listed in the file, one expression per line - by default, each expression is treated as a literal, but 'regex:' & 'glob:' prefixes are supported, with '==>' to specify a replacement string other than the default of '***REMOVED***'.
  -fi, --filter-content-including <glob>
                           do file-content filtering on files that match the specified expression (eg '*.{txt,properties}')
  -fe, --filter-content-excluding <glob>
                           don't do file-content filtering on files that match the specified expression (eg '*.{xml,pdf}')
  -fs, --filter-content-size-threshold <size>
                           only do file-content filtering on files smaller than <size> (default is 1048576 bytes)
  -p, --protect-blobs-from <refs>
                           protect blobs that appear in the most recent versions of the specified refs (default is 'HEAD')
  --no-blob-protection     allow the BFG to modify even your *latest* commit. Not recommended: you should have already ensured your latest commit is clean.
  --private                treat this repo-rewrite as removing private data (for example: omit old commit ids from commit messages)
  --massive-non-file-objects-sized-up-to <size>
                           increase memory usage to handle over-size Commits, Tags, and Trees that are up to X in size (eg '10M')
  <repo>                   file path for Git repository to clean