假設我在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然後再次推送 –