Created
October 3, 2017 15:31
-
-
Save IrishPrime/3bdb9e4dde74b2e68c74d29801a6a76a to your computer and use it in GitHub Desktop.
Revisions
-
IrishPrime created this gist
Oct 3, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ #!/bin/bash # Delete remote branches which have been merged into master, excluding the # current branch, then remove local branches pointing to remote branches which # have been deleted. # Test git branch -r --merged master | grep -v -e $(git symbolic-ref --short HEAD) -e master | sed 's/origin\///' # Delete # git branch -r --merged master | grep -v -e $(git symbolic-ref --short HEAD) -e master | sed 's/origin\///' | xargs -n 1 git push --delete origin # git fetch --prune