We use a subtree deployment a lá this Gist to deploy a subdirectory of our Yeoman project. In our case, the branch is called production, not gh-pages.
This worked perfectly until yesterday when the Git server rejected the command
git subtree push --prefix dist origin production
! [rejected] 9fe1683aa574eae33ee6754aad702488e0bd37df -> production (non-fast-forward)
error: failed to push some refs to 'firstname.lastname@example.org:web-and-new-media/graduation2015.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
Your branch is up-to-date with 'origin/production'.
git subtree push
The trick was to chain the subtree split into a forced push:
git push origin `git subtree split --prefix dist master`:production --force
I got this from the Addendum of http://clontz.org/blog/2014/05/08/git-subtree-push-for-deployment/, who actually references this answer on Stack Overflow. I had skimmed this one earlier but Steve Clontz's post made it click for me.