Skip to content

Instantly share code, notes, and snippets.

@felixSchl
Last active September 21, 2016 21:45
Show Gist options
  • Save felixSchl/5cb0dc25860916d9a66ca6622457983d to your computer and use it in GitHub Desktop.
Save felixSchl/5cb0dc25860916d9a66ca6622457983d to your computer and use it in GitHub Desktop.
git-du
# usage: git du [max-size]
function git-du {
local -r max_size="${1:-0}"
du | while read -r line; do
read -r s n <<< "$line"
if ((s > max_size)) && git ls-files "$n" --error-unmatch &> /dev/null; then
echo "$line"
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment