! [rejected] master -> master (fetch first) error: failed to push some refs to ‘https://gitee

宋昕
2023-12-01

如何解决 ! [rejected] master -> master (fetch first) error: failed to push some refs to ‘https://gitee.com/xzyxiaozhiyu/listen-together-applet.git’

当提交代码时就会提示报错

git add .
git commit -m"更新了分包"
git push

报错如下

 ! [rejected]        master -> master (fetch first) error: failed to push some refs to 'https://gitee.com/xzyxiaozhiyu/listen-together-applet.git'

查阅了资料,最终得出解决方案并找到了原因
原因:因为README.md文件不在本地代码目录中,所以会提示报错,以通过如下命令进行代码合并

git pull --rebase origin master

然后再运行

git push

代码就成功提交啦

`

 类似资料: