Created
June 10, 2017 08:58
-
-
Save buddhike/38e54ac15233bb28538c4b094d024fa6 to your computer and use it in GitHub Desktop.
init hugo repo for deployment
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 | |
set -e | |
REPO=$1 | |
REMOTE=$(git remote -v | grep upstream | grep -v grep | cat) | |
if [ -z $REMOTE ] | |
then | |
if [ -z $REPO ] | |
then | |
echo "Must specify a valid upstream repo." | |
exit 1 | |
fi | |
echo "Upstream not set. Setting it now..." | |
git remote add upstream $REPO | |
fi | |
git checkout --orphan gh-pages | |
git reset --hard | |
git commit --allow-empty -m "Initializing gh-pages branch" | |
git push upstream gh-pages | |
git checkout master | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment