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/bash | |
# targetBranch=${2:-$(git rev-parse --abbrev-ref HEAD)} | |
# echo "target branch is '$targetBranch'" | |
remote=${1:-origin} | |
git remote prune $remote | |
# get remote merged branches | |
git branch -r --merged master | \ | |
# remove master or develop case-insensitive | |
egrep -iv '(master|develop|dev)' | \ | |
# replace remote/ with '' (nothing) |