Created
January 31, 2017 20:01
-
-
Save QWxleA/412d0b7fb737afcf61cc8c8d42545942 to your computer and use it in GitHub Desktop.
Create an orphan gh-pages directory in master
This file contains 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 | |
# | |
# Run this in a repo checked out from github | |
#create gh-pages branch | |
git checkout --orphan gh-pages | |
git reset | |
echo "My new site" >> index.html | |
git add index.html | |
git commit --allow-empty -m "Initial commit gh-pages" | |
git push --set-upstream origin gh-pages | |
#in master create a linked checkout to gh-pages | |
git checkout --force master | |
git worktree add _export gh-pages | |
#disable jekyll and add _export to gitignore | |
touch .nojekyll | |
echo "_export" >> .gitignore | |
git add . | |
git commit -am "preparing for _export in a git worktree" | |
git push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment