Created
October 12, 2012 19:56
-
-
Save wx13/3881163 to your computer and use it in GitHub Desktop.
auto update gh-pages from doc dir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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