Created
April 9, 2021 22:56
-
-
Save mwdchang/e007ffdaa3ed6d604fe1532f41067921 to your computer and use it in GitHub Desktop.
gh-pages branch manipulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DIR=dist | |
git checkout --orphan gh-pages | |
npm run build | |
git --work-tree $DIR add --all | |
git --work-tree $DIR commit -m "gh-pages" | |
git push origin HEAD:gh-pages --force | |
rm -rf $DIR | |
git checkout -f master | |
git branch -D gh-pages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment