Skip to content

Instantly share code, notes, and snippets.

@wx13
Created October 12, 2012 19:56
Show Gist options
  • Save wx13/3881163 to your computer and use it in GitHub Desktop.
Save wx13/3881163 to your computer and use it in GitHub Desktop.
auto update gh-pages from doc dir
#!/bin/bash
# found at: http://happygiraffe.net/blog/2009/07/04/publishing-a-subdirectory-to-github-pages/
parent_sha=$(git show-ref -s refs/heads/gh-pages)
doc_sha=$(git ls-tree -d HEAD jslint4java-docs/src/main/resources | awk '{print $3}')
new_commit=$(echo "Auto-update docs." | git commit-tree $doc_sha -p $parent_sha)
git update-ref refs/heads/gh-pages $new_commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment