Skip to content

Instantly share code, notes, and snippets.

@zsoobhan zsoobhan/README.md
Last active Jul 19, 2018

Embed
What would you like to do?
Lists all branches on remote repository that are merged to develop

Usage:

bash list_merged_remote_and_delete.sh
git branch -r --merged develop |
grep origin |
grep -v develop |
grep -v release |
grep -v master |
sed -E "s|^ *origin/||"
for branch in $(git branch -r --merged develop | grep origin | grep -v develop | grep -v release | grep -v master | sed -E "s|^ *origin/||g")
do
git push origin $branch --delete
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.