Skip to content

Instantly share code, notes, and snippets.

@phatnhse
Last active July 12, 2018 04:06
Show Gist options
  • Save phatnhse/41fc21eb126e9f6d49dfd5211f8f1e23 to your computer and use it in GitHub Desktop.
Save phatnhse/41fc21eb126e9f6d49dfd5211f8f1e23 to your computer and use it in GitHub Desktop.
Remove all local branch except "develop"
branches=$(git branch | tr -d " *")
output=""
for branch in $branches
do
if [[ $branch != "develop" ]]; then
output="$output $branch"
fi
done
git branch -d $output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment