git push 報non-fast-forward updates were rejected 錯誤

錯誤:git

To https://enzhouguo@github.com/enzhouguo/video_web.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://enzhouguo@github.com/enzhouguo/video_web.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'Note about
fast-forwards' section of 'git push --help' for details.

解決辦法:github

1,強推,即利用強覆蓋方式用你本地的代碼替代git倉庫內的內容web

git push -f  -u origin masteride

2,先把git的東西fetch到你本地而後merge後再pushfetch

$ git fetchcode

$ git mergerem

相關文章
相關標籤/搜索