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
#Remove remote branches, that are merged to master. Leave 20 latest branches just in case. | |
git pull | |
for branch in `git branch -r --merged origin/master | grep -v HEAD`;do echo -e `git show --format="%at" $branch | head -n 1` \\t$branch; done | sort -r | cut -c 20- | awk 'NR>20' | while read line ; do git push origin --delete $line; done |