Skip to content

Instantly share code, notes, and snippets.

@janlelis
Created February 8, 2016 22:01
Show Gist options
  • Save janlelis/b9a4d3cb273ac07114c5 to your computer and use it in GitHub Desktop.
Save janlelis/b9a4d3cb273ac07114c5 to your computer and use it in GitHub Desktop.

Revisions

  1. janlelis created this gist Feb 8, 2016.
    15 changes: 15 additions & 0 deletions update-production-branch.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/sh

    if [ -n "$(git status --porcelain)" ]; then
    echo "\033[31;1mWorking directory needs to be clean\033[0m";
    exit 1
    else
    git checkout production &&
    git rebase develop &&
    npm run build &&
    git add -f dist &&
    git commit -m "Update to $(git rev-parse develop)" &&
    git push -f origin production &&
    git checkout develop &&
    echo "\033[32;1mSuccessfully updated and pushed production branch\033[0m"
    fi