Created
December 13, 2018 05:22
-
-
Save mukund-murali/bc9dd3c0c3f0f0cc3b4b48ca053abcc4 to your computer and use it in GitHub Desktop.
Deletes a branch if master has it's changes
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
if [ -z $1 ]; then echo "Specify branch name"; exit; fi | |
git checkout master | |
git pull origin master | |
git checkout $1 | |
git merge master | |
git checkout master | |
out=`git diff master $1` | |
if [ -z "$out" ]; then | |
git branch -D $1 | |
else | |
echo 'Diff not empty' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment