git push origin master错误

2023-05-25,,

以下错误是因为远程有的文件,本地没有,故而无法push文件到远程

$ git push origin master

To git@github.com:AntonioSu/learngitWindows.git

! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@github.com:AntonioSu/learngitWindows.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.

通过以下指令就可以完成

$ git pull

git push origin master错误的相关教程结束。

《git push origin master错误.doc》

下载本文的Word格式文档,以方便收藏与打印。