Skip to content

Instantly share code, notes, and snippets.

@MushuLeDragon
Last active August 19, 2020 13:14
Show Gist options
  • Save MushuLeDragon/9b7d17201430f2365cb117b8f5460693 to your computer and use it in GitHub Desktop.
Save MushuLeDragon/9b7d17201430f2365cb117b8f5460693 to your computer and use it in GitHub Desktop.
Way to publish subfolder on Github Pages
# Commands to set a subfolder on Github Pages instead ROOT
# Inspired from
# - https://gist.github.com/cobyism/4730490
# And
# - https://stackoverflow.com/a/36782614/7998119
# Command to publish on Remote
git subtree push --prefix build_folder origin gh-pages
# Command to update the branch after a commit
git push origin `git subtree split --prefix build_folder master`:gh-pages --force
# Where build_folder is the target folder to publish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment