天天看點

Git第一次送出push到遠端庫報錯

報錯資訊如下:

error: failed to push some refs to '[email protected]:zzzz/zzzz.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
           

出現報錯的原因是:碼雲中的README.md檔案不在本地代碼目錄中。導緻本地版本庫裡的檔案和遠端倉庫裡的檔案出現沖突。

解決辦法:

1:取回遠端倉庫的某分支的更新,然後與本地的指定分支合并,解決沖突

git pull --rebase origin master
           

    現在就可以git push了。

2:強制送出到遠端倉庫,但是會導緻遠端倉庫裡的readme.md檔案丢失

git push -u origin master -f
           
下一篇: greenDao---CRUD