Created
March 30, 2013 13:50
-
-
Save reyoung/5276759 to your computer and use it in GitHub Desktop.
Personal Git Finish Feature Script.
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 | |
echo "Finish Feature" | |
function GitPush { | |
REMOTES=$@ | |
# If no remotes were passed in, push to all remotes. | |
if [[ -z "$REMOTES" ]]; then | |
REM=`git remote` | |
# Break the remotes into an array | |
REMOTES=$(echo $REM | tr " " "\n") | |
fi | |
# Iterate through the array, pushing to each remote | |
for R in $REMOTES; do | |
echo "Pushing to $R..." | |
git push $R | |
done | |
} | |
git stash | |
if [ "$?" = "0" ]; then | |
git flow feature finish | |
if [ "$?" = "0" ]; then | |
GitPush | |
if [ "$?" = "0" ]; then | |
git stash pop | |
fi | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment