Last active
September 21, 2016 21:45
-
-
Save felixSchl/5cb0dc25860916d9a66ca6622457983d to your computer and use it in GitHub Desktop.
git-du
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
# 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