git push報錯! [rejected] master -> master (non-fast-forward)的有效解決方案

在對本地的代碼add 和 commit後
進行 git push操作報錯
! [rejected] master -> master (non-fast-forward)

解決方案

  • 1、git pull origin master --allow-unrelated-histories //把遠程倉庫和本地同步,消除差異
  • 2、重新add和commit操作
  • 3、git push origin master
發佈了22 篇原創文章 · 獲贊 22 · 訪問量 1251
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章