一、問題
在進行【git push orgin master】的時候出現如下錯誤
! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/pzq7025/KG.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and 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 push origin master -f】就可以解決這個問題。
note:這個命令是強制進行如果git倉庫有內容,這個指令會把原來的內容覆蓋掉。
三、結果展示
四、參考
https://blog.csdn.net/crazydony/article/details/51983343