rewrite commit authors using git-filter-repo
Previously, people used git-filter-branch ↗ to rewrite commit history but it is no longer used or used less as it’s somewhat deprecated as of Git 2.24, Q4 2019 ↗. Instead, I can now use git-filter-repo ↗.
git filter-repo is not only faster than the git filter-branch but also equipped with more capabilities.
Installation
- brew
- Since I’m using macOS, I can use Homebrew to easily install it.
brew install git-filter-repo- After the installation, I can use either
git filter-repoorgit-filter-repowith the dash.
- pip
- Alternatively, I can use
pipto install the package:
python3 -m pip install --user git-filter-repo - Alternatively, I can use
Make sure the path to python is added on the path, otherwise I’ll need to use absolute path to where it is installed.
<PATH TO PYTHON>/<VERSION>/bin/git-filter-repo