error: failed to push some refs to 'https://github.com/..
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first 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.
出现错误的主要原因是github中的README.md文件不在本地代码目录中
在stackoverflow上找到了解决办法, 是用 -f 参数 来push: git push -f origin master
——————————————————————————————————————————————————
2018.1.20 更
方法二
执行git pull --rebase origin master命令可以发现文件中多了 readme.md文件
执行git push -u origin master
上传成功