Skip to content

Instantly share code, notes, and snippets.

@AidanRocke
Created April 28, 2018 23:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save AidanRocke/2f20b1855e12f25d63aa224fb124173f to your computer and use it in GitHub Desktop.
Save AidanRocke/2f20b1855e12f25d63aa224fb124173f to your computer and use it in GitHub Desktop.
Gitbook on Github pages
## taken from: http://sangsoonam.github.io/2016/08/02/publish-gitbook-to-your-github-pages.html
# install the plugins and build the static site
gitbook install && gitbook build
# checkout to the gh-pages branch
git checkout gh-pages
# pull the latest updates
git pull origin gh-pages --rebase
# copy the static site files into the current directory.
cp -R _book/* .
# remove 'node_modules' and '_book' directory
git clean -fx node_modules
git clean -fx _book
# add all files
git add .
# commit
git commit -a -m "Update docs"
# push to the origin
git push origin gh-pages
# checkout to the master branch
git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment