Skip to content

Instantly share code, notes, and snippets.

@ramnathv
Created October 14, 2012 01:43
Show Gist options
  • Save ramnathv/3886937 to your computer and use it in GitHub Desktop.
Save ramnathv/3886937 to your computer and use it in GitHub Desktop.
Pushing Documentation to Github Pages
# ignore built md and html files in the slides directory
slides/*.html
slides/*.md
slides/fig/*
slides/figures/*
# Makefile
GITHUB_REPO ?= yourname/project
# Sends the documentation to gh-pages.
docs.deploy: docs
cd docs && \
git init . && \
git add . && \
git commit -m "Update documentation."; \
git push "git@github.com:$(GITHUB_REPO).git" master:gh-pages --force && \
rm -rf .git
.PHONY: docs.deploy
@ramnathv
Copy link
Author

I tried this and it works. Basically it works by initializing the deploy directory as a git repository, pushing it to a remote gh-pages branch (by force) and removing the .git directory so that all history is erased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment