git push 到远程仓库出现错误

本地仓库连接远程仓库

git remote add origin [远程仓库的地址]

将本地仓库master push到远程仓库 出现了以下错误

To [仓库地址]

 ! [rejected]        master -> master (non-fast-forward)

error: failed to push some refs to 'https://gitee.com/aabbccddffee/SpringCloudStreamTest.git'

hint: Updates were rejected because the tip of your current branch is behind

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

原因是本地的仓库没有readme.md 我们只要先pull一下就可以了

git pull -rebase origin master

接下来在push就成功了

git push -u origin master

发布了41 篇原创文章 · 获赞 4 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_37992974/article/details/92109334