Last active
February 4, 2020 07:57
-
-
Save shubhamoli/c88b267bf9b312b0a4cf276394e242f0 to your computer and use it in GitHub Desktop.
Remove Merged branches in remote
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 | |
// cut -d '/' -f 2- : this will remove "origin/" from output of first command | |
// | |
// I've excluded master, staging and development branches for safety | |
// But You can change this to suit your use-case | |
git branch -r --merged | cut -d ‘/’ -f 2- | grep -v ’master\|staging\|development’ | xargs git push --delete origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment