Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alexyoung
Created November 27, 2011 23:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexyoung/1398458 to your computer and use it in GitHub Desktop.
Save alexyoung/1398458 to your computer and use it in GitHub Desktop.
Publish a subdirectory of documentation to a gh-pages branch
publishdocs:
$(eval PARENT_SHA := $(shell git show-ref -s refs/heads/gh-pages))
$(eval DOC_SHA := $(shell git ls-tree -d HEAD docs | awk '{print $$3}'))
$(eval COMMIT := $(shell echo "Auto-update docs." | git commit-tree $(DOC_SHA) -p $(PARENT_SHA)))
@git update-ref refs/heads/gh-pages $(COMMIT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment