Created
April 3, 2012 15:49
-
-
Save nategood/2293080 to your computer and use it in GitHub Desktop.
See diffs for remote branches.
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
#! /bin/bash | |
BRANCHES="" | |
BLIST=`git branch -a | grep remotes/origin | sed s_remotes/__` | |
for BRANCH in $BLIST; do | |
git --no-pager diff HEAD...$BRANCH | |
if [ "$?" = "0" ]; then | |
CLEAN_BRANCH=`echo $BRANCH | sed s_origin/__` | |
echo "Add Remote Branch $CLEAN_BRANCH to Kill List (y/n)?" | |
read INPUT | |
if [ "$INPUT" = "y" ]; then | |
BRANCHES="$BRANCHES \ngit push origin :$CLEAN_BRANCH" | |
fi | |
echo $BRANCHES | |
fi | |
done; | |
echo "The Kill List" | |
echo "-------------" | |
echo $BRANCHES |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Warning: I'm no a bash expert. This has just proven handy for me over the years.