Git Clients

git-filter-repo – rewrite Git repository history

git-filter-repo provides a purpose-built way to rewrite the history of a Git repository. It is intended for jobs in which the existing sequence of commits needs to be transformed, such as removing accidentally committed credentials, extracting part of a project or reorganising directory paths across old revisions.

History rewriting changes commit identities and can disrupt other clones, branches and collaborators. The utility therefore protects against accidental use by expecting a fresh clone unless the user deliberately overrides the safety check. It can also analyse a repository before destructive changes are made.

Because history transformations alter hashes, a rewritten repository is normally distributed deliberately rather than mixed with its old version. The reporting mode is useful before changing anything, and the dry-run option lets experienced users inspect how a proposed set of filters would behave.

This is free and open source software.

Key Features

  • Filters historical commits by file path, directory, glob or regular expression, retaining or excluding selected content.
  • Removes unwanted large objects, sensitive strings, files or entire directories from old commits.
  • Rewrites filenames and directory layouts across history, including moves into subdirectories and extracted subprojects.
  • Changes commit messages, tags, author information and other historical metadata when requested.
  • Supports callback-based transformations for more specialised history-rewriting tasks.
  • Provides repository analysis reports to help identify large or problematic historical objects.
  • Prunes commits left empty by filtering and handles degenerate merges arising from rewritten history.
  • Rewrites commit references in messages and can maintain replacement references for previous commit hashes.
  • Repacks the transformed repository to help reclaim storage after filtering.
  • Refuses normal destructive rewriting outside a fresh clone unless explicitly forced.

Website: github.com/newren/git-filter-repo
Support:
Developer: Elijah Newren
License: MIT License

git-filter-repo options

git-filter-repo is written in Python. Learn Python with our recommended free books and free tutorials.


Related Software

Git Tools for Diff Review and Repository History
difftasticStructural diff tool that compares files based on their syntax
git-filter-repoQuickly rewrite git repository history
onefetchDisplays information about a local Git repository
git-statsLocal git statistics including GitHub-like contributions calendars
diff-so-fancyAttractive diffs with diff-highlight and more
BFG Repo-CleanerClean unwanted data from Git repository history
git-deltaViewer for git and diff output
gitlogueCinematic Git commit replay tool
git-quick-statsAccess various statistics in a git repository
git-whoCommand-line Git analysis tool
git-standupRecall what you did on the last working day
git-of-theseusAnalyze how a Git repo grows over time
git-sizerCompute various size metrics for a git repository
diffnavGit diff pager based on delta but with a file tree, à la GitHub
critiqueTerminal UI for reviewing git diffs
git-big-pictureVisualization tool for Git repositories
herculesGain advanced insights from Git repository history
keifuTUI that visualizes Git commit graphs
git-fameGit repository collaborators sorted by contributions
needleHighlights GitHub PRs
mergirafGit merge driver
git-historyAnalyze Git history using SQLite
ecTerminal Git mergetool
diffrWord-by-word diff highlighting utility
git-scopeFast TUI dashboard to view the git status of all your repositories
mamediffManages unstaged and staged Git diffs
deadbranchKeep Git repositories tidy
GitTopLightweight desktop client for GitHub notifications
git-heatmapGenerates a customizable heatmap

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted