Skip to content

Instantly share code, notes, and snippets.

@willread
Created May 4, 2013 16:57
Show Gist options
  • Save willread/5518072 to your computer and use it in GitHub Desktop.
Save willread/5518072 to your computer and use it in GitHub Desktop.
Create a clean gh-pages branch.
# delete any existing branch
git branch -D gh-pages
git push origin --delete gh-pages
# create new branch and switch to it
git checkout -b gh-pages
# remove all but git files
rm -rf $(ls -a | egrep -v '^(\.|\.\.|\.git)$')
# create an empty index.html and commit it
touch index.html
git add -A
git commit -m "Created clean gh-pages branch"
# push it, push it real good
git push -u origin gh-pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment