Skip to content

Instantly share code, notes, and snippets.

@krassdanke
Last active February 5, 2023 21:00
Show Gist options
  • Save krassdanke/afe69ab8656d7b5038ab8faf836dd9cf to your computer and use it in GitHub Desktop.
Save krassdanke/afe69ab8656d7b5038ab8faf836dd9cf to your computer and use it in GitHub Desktop.
git-fatfiles
# All credit goes to "Vi." @ stackoverlow
# https://stackoverflow.com/questions/1029969/why-is-my-git-repository-so-big
git rev-list --all --objects | \
sed -n $(git rev-list --objects --all | \
cut -f1 -d' ' | \
git cat-file --batch-check | \
grep blob | \
sort -n -k 3 | \
tail -n40 | \
while read hash type size; do
echo -n "-e s/$hash/$size/p ";
done) | \
sort -n -k1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment