I'm having trouble pushing to my gh-pages
branch.
I have an organization account, with both server and client code in it (though I think this should not really matter). So the structure is like so:
my-org
my-repo
client
src
server
src
This is how I am reproducing the issue:
- create a new directory on my machine, just to be sure everything is clean
- clone the repo into it
- build the static angular app - this creates a directory /client/dist
My directory now contains this:
my-repo
client
src
dist <-- this is what I want to go into gh-pages branch
server
src
The files in this directory are want to serve via github pages. So I run
git subtree push --prefix client/dist origin gh-pages
This however outputs:
git subtree push --prefix client/dist origin gh-pages
git push using: origin gh-pages
To github.com:my-org/my-repo.git
! [rejected] c7ac6936acbe0f5751755d60776074b98dae54d6 -> gh-pages (non-fast-forward)
error: failed to push some refs to 'git@github.com:my-repo/my-repo.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I really don't understand this message (how can anything be behing its remote counterpart in this situation?), and also following the advice (git pull) does nothing,
git pull on master and on gh-pages returns the expected:
Already up-to-date.
What am I missing? (I'm on git version 2.10.1)