How can I better manage a git repo for github pages that uses yeoman?

With Github pages for users and organizations, everything in the root of the master branch is what gets published. I am using yeoman/grunt to build my site and do not want to push my source files there.

When using something like the webapp generator, all of the public files are put in a dist folder.

Is there some way that I can keep all of my source files in a develop branch and merge the dist folder into the master branch and also change the path so that the files are in the root?


When looking up deployment ideas, I just stumbled across a page on the yeoman site itself that talks about this, although it’s for project pages and not user/org pages, I may have to modify it some. I will post back after I get it working.

  • applying updates for authored yeoman generator to npm global install/update
  • Yeoman with git
  • Use yeomen generator branch locally
  • npm install command doing nothing
  • Grunt dist with git and multiple servers
  • yo jhipster : Failed to connect to “git://”
  • Best practices to store “dist” folder on repo for deploy
  • How do I create a deploy git branch for my Yeoman project?
  • 3 Solutions collect form web for “How can I better manage a git repo for github pages that uses yeoman?”

    You can use git filter-branch:

    $ git filter-branch --subdirectory-filter dist/ -f

    Use git submodule.

    Check the blog for How to generate github pages in a submodule

    FYI gulp-webapp has a recipe for this that works great. I switched from a user/org page to a project page to take advantage of it, and realized in doing so I didn’t actually need a user/org page at all.

    Git Baby is a git and github fan, let's start git clone.