Last active
June 5, 2019 13:35
-
-
Save AndersDJohnson/5942821 to your computer and use it in GitHub Desktop.
For GitHub Pages, copy a subtree to root of gh-pages branch.
This file contains 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 | |
DIR=dist | |
parent_sha=$(git show-ref -s refs/heads/gh-pages) | |
doc_sha=$(git ls-tree -d HEAD "$DIR" | 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