Accidentally committed large log files via git add . and pushed to GitHub:
6260445 example/110_gentoo/docker_min_hpz6/logs/setup01_run_20260306_200733.log
4553609 example/110_gentoo/docker_min_hpz6/logs/setup01_run_20260306_192017.log
3480199 example/110_gentoo/docker_min_hpz6/logs/setup01_run_20260307_012725.log
git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| awk '/^blob/ {print $3, $4}' \
| sort -rn | head -20uv tool install git-filter-repo
export PATH="/home/kiel/.local/bin:$PATH"git filter-repo --invert-paths --path example/110_gentoo/docker_min_hpz6/logs --forceThis removes the origin remote as a safety measure.
echo "example/110_gentoo/docker_min_hpz6/logs/" >> .gitignore
git add .gitignore
git commit -m "chore: ignore docker logs"git remote add origin git@github.com:plops/cl-py-generator.git
git push origin --force --all
git push origin --force --tagsOn any other computer that has this repo checked out, the safest approach is a fresh clone:
cd ..
rm -rf cl-py-generator
git clone git@github.com:plops/cl-py-generator.gitAlternatively (if you have local changes to preserve):
git fetch origin
git reset --hard origin/master
git reflog expire --expire=now --all
git gc --prune=now --aggressivegit filter-reporewrites all commit hashes from the rewritten point onward.- Force push is required because the remote history no longer matches.
- All collaborators/clones need to fresh-clone or hard-reset after the force push.