You are building a website with a static site generator like Hexo or Jekyll? You want to have website source code on GitHub and the website running on gh-pages without maintaining two Git repository? You need subtree!
You are making slideshows with Reveal.js? You want to have slideshow source code on GitHub and the slideshow running on gh-pages without maintaining two Git repository? You need subtree!
Sometimes it's useful to have a subfolder on gh-pages and all the source code on the master branch and all of that in the same root directory. In fact for all project that you want to see his source code hosted on GitHub and the building result living on gh-pages.
For this example, I suppose you have a
build folder under the project's root directory.
- Remove the
buildfolder from the project's
- Make git aware of the
- Each time you re-build the project to a final release, use
subtree pushto send the build on the gh-pages branch on GitHub: