查看: 107|回覆: 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.

在本版发帖返回顶部