查看: 89|回复: 0

gitee推送报错error: failed to push some refs to

[复制链接]

2

主题

0

回帖

0

积分

热心网友

金币
0
阅读权限
220
精华
0
威望
0
贡献
0
在线时间
0 小时
注册时间
2008-3-17
发表于 2021-12-28 17:27:00 | 显示全部楼层 |阅读模式

今天在gitee创建了一个项目,打算把本地代码推送上去,发现报错了,报错如下:

error: failed to push some refs to 'https://gitee.com/xxxx'
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.

分析原因:

是因为README.md文件不在本地代码目录中

解决方法:

执行以下命令,把README.md拉到本地

git pull --rebase origin master

然后执行以下命令,推送文件

git push origin master


来源:https://www.cnblogs.com/lucktomato/p/15741512.html
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部