我試圖推動在GitHub上的本地回購,但git push
不工作對我來說以下是錯誤推送操作不工作
git push https://github.com/MandarSant/Mandars_First_Repo.git master
To https://github.com/MandarSant/Mandars_First_Repo.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/MandarSant/Mandars_First_Repo.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.
因爲它提到你必須首先協調遠程分支和你的本地分支,所以'git pull'然後'git push' – CoryKramer
git pull origin master --rebase – clonq
你甚至讀過錯誤信息嗎? – Antwane