Skip to content

Instantly share code, notes, and snippets.

@tommedema
Created May 14, 2012 12: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 tommedema/2693718 to your computer and use it in GitHub Desktop.
Save tommedema/2693718 to your computer and use it in GitHub Desktop.
#!/bin/sh
######################################################
# Deploys working repository to git deployment branch
######################################################
#get the status of the working repository
status=`git status --porcelain`
#check if the working repository is clean
if [ "$status" = "" ]
then
echo `git branch -f deployment`
echo `git push origin deployment`
echo "OK. Done deploying to git deployment branch."
exit 0 #success
else
echo `git status`
echo "Error. Working repository is not clean. Commit your changes..."
exit 1 #failure
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment