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,成功推送到远程仓库:

相关推荐
noravinsc12 小时前
关于Git Flow
git
2601_9618451512 小时前
粉笔行测5000题电子版|pdf|解析
pdf·新媒体运营·github·个人开发·内容运营·规格说明书·极限编程
蜜獾云13 小时前
在Git中配置用户名和密码
git
scx_link14 小时前
通过git bash在本地创建分支,并推送到远程仓库中
开发语言·git·bash
用户7735300845115 小时前
gorillamux:Go语言路由库的实用选择
github
BBWEYY终身尊贵会员16 小时前
2026年6月四款建站工具怎么选?BBWEYY、比文云、GitHub Copilot、Dreamweaver 简明对比
github·copilot·dreamweaver
南大白16 小时前
IntelliJ IDEA 运行时的 JVM 本地内存溢出崩溃
git
DogDaoDao16 小时前
【GitHub】CL4R1T4S:AI 系统提示词的透明革命
人工智能·python·ai·大模型·github·ai agent·cl4r1t4s
CHENG-JustDoIt16 小时前
AI工具 | 爆火开源项目Odysseus AI 工作台:从项目介绍、部署情况及其使用等多方位分析指南(含详细步骤)
大数据·人工智能·windows·python·ai·开源·github
码农小旋风17 小时前
Claude Code 基础用法大全:对话、分析、修改、测试、Git 和工作流
人工智能·git·chatgpt·claude