git push -u origin master 报错

报错如下:

To https://github.com/MAZHIQUNCM/my.git ! [rejected] master ->
master (fetch first) error: failed to push some refs to
‘https://github.com/MAZHIQUNCM/my.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创建的仓库中有reame.md文件,而本地仓库中没有
因此要将github中的readme.md并入本地仓库中

敲入:$ git pull --rebase origin master
再试下:$ git push -u origin master

就成功了!

你可能感兴趣的:(git)