Skip to content

Instantly share code, notes, and snippets.

@coopermaruyama
Created March 3, 2015 04:56
Show Gist options
  • Save coopermaruyama/1b5506a31b4b6a69651b to your computer and use it in GitHub Desktop.
Save coopermaruyama/1b5506a31b4b6a69651b to your computer and use it in GitHub Desktop.
Deploy Jekyll build (_site) to github pages (assumes you're using master branch rather than gh-pages)
#!/bin/sh
# To use:
# 1. save this file as /usr/bin-git-jekyll-deploy then `sudo chmod 775 /usr/bin/git-jekyll-deploy`
# 2. create a "source" branch where you'll maintain your jekyll site: git branch -b source
# 3. run `jekyll build`
# 4. run `git add . && git commit -am "update content"`
git branch -D master
git checkout -b master
git checkout source
git push origin `git subtree split --prefix _site master`:master --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment