Skip to content

Instantly share code, notes, and snippets.

@tomleo
Created February 3, 2015 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomleo/8a0a6d3c6d6dd83374ff to your computer and use it in GitHub Desktop.
Save tomleo/8a0a6d3c6d6dd83374ff to your computer and use it in GitHub Desktop.
Cleaning up remote branches
#! /bin/bash
array=(
'feature-branch-1'
'feature-branch-2'
'feature-branch-3'
'feature-branch-4'
'feature-branch-5'
)
for i in "${array[@]}"; do
if git branch -a --merged | grep -q $i; then
git push origin :$i
else
echo "Branch $i has not been merged"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment