Last active
February 2, 2024 16:43
-
-
Save vepetkov/e3c66dd2a8c10b2f951a001684ebb737 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parse the whole git history and show files larger than 1Mb (2^20 b) | |
git rev-list --objects --all | | |
git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | | |
sed -n 's/^blob //p' | | |
awk '$2 >= 2^20' | | |
sort --numeric-sort --key=2 | | |
cut -c 1-12,41- | | |
$(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest | |
# Show full history of commits that changes a file / path | |
git log --full-history -- [file path] | |
# Rewrite the history by skipping given paths, ie deleting paths/files from the full history | |
# install git-filter-repo from https://github.com/newren/git-filter-repo/blob/main/INSTALL.md | |
git-filter-repo --invert-paths --path <path_1> --path <path_2> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment