http://blog.****.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