Skip to content

Instantly share code, notes, and snippets.

@reyoung
Created March 30, 2013 13:50
Show Gist options
  • Save reyoung/5276759 to your computer and use it in GitHub Desktop.
Save reyoung/5276759 to your computer and use it in GitHub Desktop.
Personal Git Finish Feature Script.
#!/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