Created
November 23, 2016 01:08
-
-
Save flaviomuniz/e282945dcff9253066dd53d8fb157c09 to your computer and use it in GitHub Desktop.
Git clear branch merged
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/sh | |
set -x | |
git checkout master | |
git fetch | |
git pull | |
git branch -r --merged | grep origin | grep -v '>' | grep -v master | xargs -L1 | cut -d"/" -f2- | xargs git push origin --delete | |
git branch --merged | grep -v master | xargs git branch -d | |
git fetch -p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment