Skip to content

Instantly share code, notes, and snippets.

@ricokareem
Last active April 6, 2018 23:22
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 ricokareem/d82a9ab936cff4d2407d0253819ded17 to your computer and use it in GitHub Desktop.
Save ricokareem/d82a9ab936cff4d2407d0253819ded17 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ "$1" != "" ]]; then
BASEBRANCH="$1"
else
BASEBRANCH="development"
fi
git remote prune origin
echo "Base Branch: ${BASEBRANCH}"
git branch --merged ${BASEBRANCH} | grep -v ${BASEBRANCH}$ | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment