$ git push -u origin master To github.com:a653398363/testtest.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'git@github.com:a653398363/testtest.git' 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.
1、在使用git 對源代碼進行push到gitHub時可能會出錯
2、出現錯誤的主要原因是github中的README.md文件不在本地代碼目錄中
3、可以通過如下命令進行代碼合並【注:pull=fetch+merge]
git pull --rebase origin master
4、執行上面代碼后可以看到本地代碼庫中多了README.md文件
5、此時再執行語句 git push 即可完成代碼上傳到github