Skip to content

Instantly share code, notes, and snippets.

@oozzal
Last active August 29, 2015 14:06
Show Gist options
  • Save oozzal/75774f86743251feffad to your computer and use it in GitHub Desktop.
Save oozzal/75774f86743251feffad to your computer and use it in GitHub Desktop.
Clean up merged git branches.
# cleanup merged git branches
function cleanlocal() {
echo "Before cleanup:";
git branch;
echo "----";
git branch --merged | grep -v "\*" | xargs -n 1 git branch -D;
echo "----";
echo "After cleanup:";
git branch;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment