Skip to content

Instantly share code, notes, and snippets.

@matteodelucchi
Created September 29, 2020 19:19
Show Gist options
  • Save matteodelucchi/f9dffd7967687d51cb5f577228fc6bd1 to your computer and use it in GitHub Desktop.
Save matteodelucchi/f9dffd7967687d51cb5f577228fc6bd1 to your computer and use it in GitHub Desktop.
local-empty-gh-pages-branch
# Make a new branch with no parents and disconnected from all other branches
git checkout --orphan gh-pages
# Remove all files from the working tree
git rm -rf .
# Make an empty commit
git commit --allow-empty -m 'Initial gh-pages commit'
# Pushing to remote will create gh-pages branch on the remote repo
git push origin gh-pages
git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment