Skip to content

Instantly share code, notes, and snippets.

@richardcornish
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardcornish/dd043891f70c9d47f75a to your computer and use it in GitHub Desktop.
Save richardcornish/dd043891f70c9d47f75a to your computer and use it in GitHub Desktop.
Creates a gh-pages branch based on a gh-pages directory, and serves its contents as a <username>.github.io website
# First time
mkdir gh-pages
touch gh-pages/index.html
git add gh-pages
git commit -m "First commit of GitHub Pages branch"
git push origin master
# Subsequent times
# Edit, save, commit, push files inside gh-pages directory
git subtree push --prefix gh-pages origin gh-pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment