Skip to content

Instantly share code, notes, and snippets.

@dfarrell-bloom
Created January 16, 2014 16:41
Show Gist options
  • Save dfarrell-bloom/8458318 to your computer and use it in GitHub Desktop.
Save dfarrell-bloom/8458318 to your computer and use it in GitHub Desktop.
remove branches interactively
for bspec in `git branch | grep -v postfix | grep -v develop | grep -v sftpupload | grep -v doc-update | grep -v splunk-proxy | grep -v splunk-storage-location | grep -v json-reformat | grep -v json-reformat | grep -v flex-pubkey-auth | grep -v prod_mgmt | grep -v netinfra | grep -v ami-baker | grep -v artifact-checksums | grep -v revert-s3-dependencies | grep -v bloom-base-box | grep -v singlestack-appless | grep -v develop | grep -v master`;
do
i="`echo $bspec | sed -e 's|^[ *]* ||'`";
echo $i
read j;
if [ "$j" = "y" ]; then
echo -e "\033[31;1mremoving\033[31m";
git branch -D "$i"; git push origin ":$i";
echo -e "\033[0m"
fi;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment