Skip to main content

Posts

Showing posts from 2019

Cleaning up your local branches with ease

Small bash script to that helps you to clean up things 1 2 3 4 5 6 7 8 9 10 11 12 #!/bin/bash for br in $( git for -each-ref --count = 30 --sort = -committerdate refs/heads/ --format = '%(refname:short)' ) ; do echo "Delete branch $br (y/n)?" read -rsn1 input if [ "$input" = "y" ] ; then echo "deleting $br" git br -D $br else echo "skip $br" fi done