Created
January 26, 2017 15:22
-
-
Save phyng/b449c759f1e530dbd075fdd2ad65a261 to your computer and use it in GitHub Desktop.
Deploying a subfolder to GitHub Pages
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
| # subfolder: dist | |
| # ref: https://gist.github.com/cobyism/4730490 | |
| # save the last commit id | |
| old_commit=$(git log -1 --pretty=format:"%h") | |
| # force add dist and commit | |
| git add dist -f && git commit -m "build: build prod" | |
| # force push subtree | |
| git push origin `git subtree split --prefix dist master`:gh-pages --force | |
| # reset to old_commit | |
| git reset "${old_commit}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment