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

相关推荐
索西引擎16 小时前
Git 大文件阻断推送的成因与历史重写修复
git
miofly16 小时前
NVIDIA 将 Run:ai 平台全面开源,纳入 DSX AI Factory 体系
开源·github
csdn2015_16 小时前
git 合并分支
大数据·git·elasticsearch
miofly16 小时前
GitHub 今日推荐|MOSS-Image:靠坐标框精确控制文字排版的图像生成模型
python·开源·github
91440623217 小时前
mac Git 账户切换问题
git·macos
留岁17 小时前
Git 命令行学习记录
git·学习·elasticsearch
小弥儿17 小时前
GitHub今日热榜 | 2026-10-19:智能体生态包场的一天
学习·开源·github
钱多多_qdd18 小时前
将 GitHub 项目导入 Gitee:三种常用方法详解
gitee·github
逛逛GitHub18 小时前
玩了一天 1.2 万人收藏的开源音乐模型,真的惊艳到我了。。。
github
笨笨饿18 小时前
#142_VS Code.map文件插件的用法
git·python·stm32·单片机·嵌入式硬件·物联网·vim