将网站内容推送到gh页面时出错

时间:2018-04-24 11:55:16

标签: git github github-pages

我在尝试将网站内容推送到gh-pages时出错:

git push using:  origin gh-pages
To https://github.com/harp29/cervini-bhatia-pc.git
 ! [rejected]        524585ce572db1fefbfb3a4b78c29ed721c92c47 -> gh-pages (non-fast-forward)
error: failed to push some refs to 'https://github.com/harp29/cervini-bhatia-pc.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.

以下是package.json的脚本:

"start": "webpack-dev-server",
"dev": "webpack -d",
"prod": "npm run clean && NODE_ENV=production webpack -p",
"clean": "rimraf ./dist/* ",
"deploy-gh": "npm run prod && git subtree push --prefix dist origin gh- 
pages"

我尝试过:

  • git pull分别在两个分支上
  • git pull --rebase

git pull --rebase我得到:Already up-to-date。 但是运行npm run deploy-gh我仍然会收到相同的错误

没有运气......之前工作正常,但由于某些原因我换了分支机构我不确定然后发生这种情况,现在它没有"同步"好像。

有什么方法可以解决这个问题吗?

0 个答案:

没有答案