Command Line API Overview
git-filter-repo provides a comprehensive set of command-line options for rewriting repository history. This page categorizes all available options by their purpose.Usage Synopsis
Option Categories
Analysis Options
Options for analyzing repository history without making modifications:--analyze- Generate reports about repository contents--report-dir- Specify directory for analysis reports
Path Filtering Options
Options for selecting which files/directories to include or exclude:--path,--path-match- Exact path matching--path-glob- Glob pattern matching--path-regex- Regular expression matching--invert-paths- Invert path selection--use-base-name- Match on basename only--paths-from-file- Load path specifications from file--subdirectory-filter- Extract subdirectory as project root--to-subdirectory-filter- Move project root to subdirectory
Path Renaming Options
Options for renaming files and directories:--path-rename,--path-rename-match- Rename paths
Content Editing Options
Options for modifying file contents:--replace-text- Replace text patterns in files--strip-blobs-bigger-than- Remove large files--strip-blobs-with-ids- Remove specific blob objects
Commit Message Options
Options for modifying commit messages:--replace-message- Replace text in commit/tag messages--preserve-commit-hashes- Don’t update commit hash references--preserve-commit-encoding- Don’t re-encode messages to UTF-8
Name & Email Filtering Options
Options for rewriting author/committer information:--mailmap- Apply mailmap file for name/email translation--use-mailmap- Use .mailmap from repository
Ref Renaming Options
Options for renaming branches and tags:--tag-rename- Rename tags by prefix
Parent Rewriting Options
Options controlling how commit ancestry is modified:--replace-refs- Control replace ref handling--prune-empty- Control empty commit pruning--prune-degenerate- Control degenerate merge pruning--no-ff- Preserve merge commit topology
Generic Callback Options
Options for custom Python code processing:--filename-callback- Process filenames--file-info-callback- Process file metadata and content--message-callback- Process commit/tag messages--name-callback- Process person names--email-callback- Process email addresses--refname-callback- Process ref names--blob-callback- Process blob objects--commit-callback- Process commit objects--tag-callback- Process tag objects--reset-callback- Process reset objects
Sensitive Data Removal Options
Options for removing sensitive data:--sensitive-data-removal,--sdr- Enable sensitive data removal mode--no-fetch- Skip fetching all refs from origin
Location Options
Options for specifying source and target repositories:--source- Source repository to read from--target- Target repository to write to
Ordering Options
Options for controlling commit processing order:--date-order- Process commits by timestamp order
Miscellaneous Options
General control options:--help,-h- Show help--version- Show version--force,-f- Skip fresh clone checks--partial- Partial history rewrite--refs- Limit to specific refs--dry-run- Preview changes without applying--debug- Show debug information--stdin- Read fast-export stream from stdin--quiet- Suppress output--no-gc- Skip garbage collection
Quick Reference
Most Common Operations
Filter to specific paths:Combining Options
Multiple options can be combined for complex filtering operations:Next Steps
- Path Options → - Detailed path filtering documentation
- Content Options → - Content modification options
- Commit Options → - Commit-related options
- Examples → - Real-world usage examples
