git push origin master 上傳失敗


http://blog.csdn.net/llf369477769/article/details/51917557 

按照網上教程用git把項目上傳到github,但是在最后一步git push origin master時出現了以下錯誤。

$ git push origin master
To github.com:frankliy/h5.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:frankliy/h5.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.

后來查了一些資料,最后用最簡單粗暴的方式,強制覆蓋已有分支(可能會丟失改動)。執行以下命令,最后上傳成功。

git push -u origin master -f

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM