我得到下面的錯誤,而我試圖從當地把我的代碼到遠程:Github上的錯誤,而試圖從地方推動代碼遠程
"To https://github.com/rishabhsrana/webdev.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to ' https://github.com/rishabhsrana/webdev.git'
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."
是否有人可以幫助我如何解決這一點,因爲,我不知道如何繼續。
僅供參考,我試過清除我的提交歷史幾分鐘回用下面的命令(雖然它得到了在命令提示符成功實施,但我的歷史仍然完好無損我的github頁):
git init
git remote add origin [email protected]:user/repo
now commit your current version of code
git add *
git commit -am 'message'
and finally force the update to GitHub:
git push -f origin master
你拉了嗎?這就是錯誤信息提示你所做的事情。 – Makoto
閱讀***錯誤:'你可能想在再次推送前先集成遠程更改(例如,'git pull ...')。 – njzk2