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

相关推荐
小弥儿12 小时前
GitHub今日热榜 | 2026-08-16:大模型微调与编码工具扎堆
学习·开源·github
fengyehongWorld12 小时前
Git 认证凭据管理
git
starp17 小时前
skill 管理,后缀为public可以被git commit
github
315356691318 小时前
DeepSeek Harness 发布后,我没急着跑 Demo,先把 `.agents/` 翻了一遍
前端·后端·github
u13013020 小时前
GitHub 热榜项目:周榜(2026-08-16)
github
暮云星影21 小时前
git版本发布
git·gitee·github·gitea
乌夷21 小时前
Git Flow 分支模型
git
m4Rk_21 小时前
【论文阅读】Agent 记忆机制(41):Agentic Plan Caching——将历史执行轨迹转化为可复用的计划记忆
论文阅读·人工智能·学习·开源·github
本地化文档21 小时前
poethepoet-docs-l10n
python·github·gitcode·sphinx