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