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

相关推荐
CoderJia程序员甲1 天前
GitHub 热榜项目 - 日榜(2026-02-05)
ai·开源·大模型·github·ai教程
stevenzqzq1 天前
git 常用操作
大数据·git
weixin_6681 天前
GitHub 2026年AI项目热度分析报告-AI分析-分享
人工智能·github
Curvatureflight1 天前
Git工作流最佳实践:从混乱到优雅
git
MicrosoftReactor1 天前
技术速递|GitHub Copilot CLI 斜杠命令速查表
github·copilot·cli
wu~9701 天前
GitHub永不遗忘,使用git push -f来覆盖的提交依旧保留
git·github
m0_694845571 天前
music-website 是什么?前后端分离音乐网站部署实战
linux·运维·服务器·云计算·github
独自破碎E1 天前
已经 Push 到远程的提交,如何修改 Commit 信息?
开发语言·github
Vermouth_001 天前
git clone的时候提示access denied
git
qq_437657271 天前
清楚本地的git并重新登录
git