Created
August 3, 2016 09:09
-
-
Save adhumi/af6b04a2fc3bc2e9be52a364f8ee6b35 to your computer and use it in GitHub Desktop.
A script to easily cleanup the branches of a git repository
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/sh | |
# cleanup_git_branches <folder> | |
pwd=$(pwd) | |
cd $1 | |
for branch in $(git branch | cut -c 3-); do | |
printf "Delete \e[32m$branch\e[0m ? (y/n, default 'no') " | |
read var | |
if [[ $var == "y" ]] | |
then | |
git branch -D $branch | |
fi | |
done | |
cd $pwd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment