git push報錯error: failed to push some refs to 'xxx.com:

GIT上傳項目到碼雲時報錯

$ git push -u origin master
To https://gitee.com/lixiaoyang123/sso.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://gitee.com/xxx/sso.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 --rebase origin master

在這裏插入圖片描述
第二 上傳

git push -u origin master

在這裏插入圖片描述
問題原因
碼雲遠程倉庫中的README.md文件不在本地倉庫中。

發佈了59 篇原創文章 · 獲贊 248 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章