git commit 出现On branch master nothing to commit, working tree clean解决方法

git commit返回的是On branch master nothing to commit, working tree clean,通过git status查看是否提交返回的也是On branch master nothing to commit, working tree clean,但在idea的git管理上可以发现确实是提交了的:

因为在idea上显示已提交,所以就尝试直接push,报错:

查看报错信息,提示需要先git pull然后再push,git pull后报错:

改用git pull origin master,报错:

之前遇到过这个报错,改用 git pull origin master --allow-unrelated-histories:

回车后直接进入merge编辑信息页面,直接:wq退出

然后再git push origin master,成功推送到远程仓库:

相关推荐
NocoBase20 小时前
【2.0 教程】第 1 章:认识 NocoBase ,5 分钟跑起来
数据库·人工智能·开源·github·无代码
量子位1 天前
字节版龙虾架构火爆GitHub!开源获35k+ Star,内置Skill全家桶,原生适配飞书
github·ai编程
悠然大月季1 天前
git 怎么导出提交历史,文件是乱码
git·git导出历史记录·git导出历史乱码
chenshiming8021 天前
在cursor下执行GIT回退版本
git
汪海游龙1 天前
开源项目 Trending AI 招募 Google Play 内测人员(12 名)
android·github
HealthScience1 天前
github怎么授权ssh(私人库授权)
运维·ssh·github
打点计时器1 天前
Git快速上手教程
git
我才是一卓1 天前
linux 安装简易 git 服务端并使用
linux·运维·git
CoderJia程序员甲1 天前
GitHub 热榜项目 - 日榜(2026-03-22)
人工智能·ai·大模型·github·ai教程