Skip to content

Instantly share code, notes, and snippets.

@warmwaffles
Created April 21, 2015 19:24
Show Gist options
  • Save warmwaffles/2f507fb94d4966df769c to your computer and use it in GitHub Desktop.
Save warmwaffles/2f507fb94d4966df769c to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "REMOVING MERGED BRANCHES..."
git branch --merged | grep -v "\*" | grep -v "master" | xargs -n 1 git branch -d
echo "PRUNING REMOTE BRANCHES..."
git remote | xargs -n 1 git remote prune
echo "EXPIRING REFLOG..."
git reflog expire --expire-unreachable=now --all
echo "CLEANING...AGGRESSIVE LIKE..."
git gc --prune=now --aggressive
echo "DONE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment