我无法赶到gh-pages
分行。
我有一个组织帐户,其中包含服务器和客户端代码(尽管我认为这不重要)。所以结构是这样的:
my-org
my-repo
client
src
server
src
这就是我重现这个问题的方法:
我的目录现在包含:
my-repo
client
src
dist <-- this is what I want to go into gh-pages branch
server
src
此目录中的文件希望通过github页面提供。所以我跑
git subtree push --prefix client/dist origin gh-pages
然而,输出:
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.
我真的不明白这个消息(在这种情况下怎样才能让远程对手感到惊讶?),并且遵循建议(git pull)什么都不做,
git pull on master和on gh-pages返回预期的:
Already up-to-date.
我错过了什么? (我在git版本2.10.1上)
答案 0 :(得分:0)
如果gh-pages分支的唯一目的是在你的repo中构建什么,只需从github中删除gh-pages分支,然后运行子树push命令