Last active
July 13, 2016 09:39
-
-
Save mlaily/f2c0a4b3f144e1c2818447550d7166ae to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
echo "Comparing current with remote:" | |
echo | |
git fetch --dry-run --prune | |
echo | |
read -p "Press enter to fetch the changes and prune the deleted branches..." | |
echo | |
git fetch --prune | |
echo | |
echo "The following locale branches are merged in origin/master and will be deleted:" | |
branches=$(git branch --merged origin/master | egrep -v "^\*?\s+master$" | sed -r 's/\*\s+//') | |
echo "$branches" | |
read -p "Press enter to continue or Ctrl+C to abort..." | |
echo | |
echo "$branches" | xargs -n 1 git branch -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment