Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Creates a gh-pages branch based on a gh-pages directory, and serves its contents as a <username> 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