Problem Description
$ 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.
the reason
The README.md file in github is not in the local directory.
Solution
git pull --rebase origin master
Run the above command first, you can see that there are more README.md files in the local directory, and then push will not go wrong.
git push -u origin master