Skip to content

Instantly share code, notes, and snippets.

@xpepermint
Last active November 28, 2016 09:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xpepermint/c35d273fad9a6f5a47053568c365f8e7 to your computer and use it in GitHub Desktop.
Save xpepermint/c35d273fad9a6f5a47053568c365f8e7 to your computer and use it in GitHub Desktop.
git `.git/hooks/pre-post` to commite bundles into `production` branch
```
#!/bin/sh
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
if [ "master" != "$branch" ]; then
exit;
fi
git checkout production
git reset --hard master
npm run build
git add ./dist -f
git commit -m 'production build'
git push origin production -f
git checkout master
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment