error: failed to push some refs to 'git@github.com:…" Updates were rejected because the remote contains work that you do not have locally.
本地和远程的文件应该合并后才能上传本地的新文件
git pull origin master
git push -u origin master
原文地址
https://www.zhangbj.com/p/31.html