Skip to content

Instantly share code, notes, and snippets.

@Igosuki
Created May 27, 2014 08:44
Show Gist options
  • Save Igosuki/7fc62cbb053aa6053890 to your computer and use it in GitHub Desktop.
Save Igosuki/7fc62cbb053aa6053890 to your computer and use it in GitHub Desktop.
Push to a release branch
wat=`expr $(git status --porcelain 2>/dev/null| egrep "^(M| M)" | wc -l)`
#Stash if there are uncommited files
if [ $wat -gt "0" ]; then
git stash
fi
#Release workflow
git branch -D build;
git checkout -b build;
grunt
git add dist -f
git commit -m "chore(release): New build `date`"
git filter-branch --subdirectory-filter dist -f;
git push origin build -f;
git co develop;
#Pop if there were uncommited files
if [ $wat -gt "0" ]; then
git stash pop
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment