Created
May 3, 2009 12:41
-
-
Save rjray/105977 to your computer and use it in GitHub Desktop.
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 | |
# I use this to create a gh-pages branch on new repos | |
if [ ! -d .git ]; then | |
echo "Must be in a repository directory!" | |
exit | |
fi | |
wd_clean=$(git status | grep 'nothing to commit') | |
if [ "x$wd_clean" == "x" ]; then | |
echo "Uncommitted changes detected, cannot continue" | |
exit | |
fi | |
git symbolic-ref HEAD refs/heads/gh-pages | |
rm .git/index | |
git clean -fdx | |
echo "Placeholder" > index.html | |
git add . | |
git commit -a -m "Establish gh-pages branch" | |
git push origin gh-pages | |
git checkout master | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment