Skip to content

Instantly share code, notes, and snippets.

@mwdchang
Created April 9, 2021 22:56
Show Gist options
  • Save mwdchang/e007ffdaa3ed6d604fe1532f41067921 to your computer and use it in GitHub Desktop.
Save mwdchang/e007ffdaa3ed6d604fe1532f41067921 to your computer and use it in GitHub Desktop.
gh-pages branch manipulation
#!/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