Skip to content

Instantly share code, notes, and snippets.

@nategood
Created April 3, 2012 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nategood/2293080 to your computer and use it in GitHub Desktop.
Save nategood/2293080 to your computer and use it in GitHub Desktop.
See diffs for remote branches.
#! /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
@nategood
Copy link
Author

nategood commented Jun 9, 2014

Warning: I'm no a bash expert. This has just proven handy for me over the years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment