問題描述
$ git push -u origin master
error: failed to push some refs to 'codechina.csdn.net:BAR_WORKSHOP/topopt-in-matlab.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.
原因
github中的README.md檔案不在本地目錄中,
解決方法
git pull --rebase origin master
先運行上面這條命令,可以看到本地目錄中多了README.md檔案,這時候再push就不會出錯了,
git push -u origin master
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/64628.html
標籤:其他
