A Docker Image with git-filter-repo integrated
# Build
docker build -t roemer/git-filter-repo .
# Pull
docker pull roemer/git-filter-repo
git clone --mirror <your repo> repo_bare
# Windows
docker run --rm -it -v C:\temp\repo_bare:/tmp2 roemer/git-filter-repo /bin/bash
# Linux
docker run --rm -it -v /tmp/repo_bare:/tmp2 roemer/git-filter-repo /bin/bash
cd tmp2
Note: Depending on your setup, you might need to add the tmp2 folder to the trusted paths:
git config --global --add safe.directory /tmp2
# Example which removes two paths
git filter-repo -invert-paths -path unneded_path1 -path unneded_path2
# Example which extracts a subfolder with history and uses this as new root
git filter-repo --subdirectory-filter subfolder/
git reflog expire --expire=now --all && git gc --prune=now --aggressive
# Untested
git push --mirror