Skip to content

Instantly share code, notes, and snippets.

@tehmoon
Last active December 12, 2017 20:27
Show Gist options
  • Save tehmoon/b63f76ca98a46f51986b9766681e4466 to your computer and use it in GitHub Desktop.
Save tehmoon/b63f76ca98a46f51986b9766681e4466 to your computer and use it in GitHub Desktop.
Disk space size of each remote branch in git
for a in $(git branch -a | grep remotes | awk '{print $1}' | sed 's/remotes\/origin\///'); do echo -n ${a} -\ ; git clean -d -x -f > /dev/null 2>&1 ;git checkout ${a} > /dev/null 2>&1; du -hs -I .git .;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment