Skip to content

Instantly share code, notes, and snippets.

@MichaelPereira
Created October 23, 2013 12:38
Show Gist options
  • Select an option

  • Save MichaelPereira/7117888 to your computer and use it in GitHub Desktop.

Select an option

Save MichaelPereira/7117888 to your computer and use it in GitHub Desktop.
Verify if a git branch has been pushed to production
for branch in `git branch | grep DMX | sed 's/\*/ /' |cut -f3 -d' '`; do
echo $branch
if [ `git branch -r --contains $branch | grep -c origin/prod` -gt 0 ]; then
git branch -d $branch
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment