假设我在GitHub页面上有一个网站。我们打电话给该网站MyFirstSite。现在,我正在尝试在一个新存储库中创建一个新的网站。该网站被称为MyNewSite。添加和滥用职权,MyNewSite文件后,我试图推动更改GH-页面分支,却收到这样的响应:无法推送到github页面
To http://github.com/Jaklabs/MyFirstSite
! [rejected] gh-pages -> gh-pages (fetch first)
error: failed to push some refs to 'http://github.com/Jaklabs/MyFirstSite'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first 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比较陌生。这可能有一个非常简单的解决方案,但是有人可以为我指出吗?
'git remote -v'显示什么? – captncraig
你肯定试图推动到原来的回购。要么你在错误的目录中,要么你的遥控器全部混在一起 – captncraig
首先尝试git pull然后再次推送 –