解决error: Committing is not possible because you have unmerged files.

2023-10-09 19:50

本文主要是介绍解决error: Committing is not possible because you have unmerged files.,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

提交代码时发现已经 git merge了,执行提交操作却报:error: Committing is not possible because you have unmerged files ( 错误:由于未合并文件,无法提交文件。).

lifeng@zx-047 MINGW64 /f/project_gitee/Test (master|MERGING)
$ git commit -m'文件整合合并'
error: Committing is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
U       djangoProject/hello_django/hello_django/asgi.py
U       djangoProject/hello_django/hello_django/settings.py
U       djangoProject/hello_django/hello_django/urls.py
U       djangoProject/hello_django/hello_django/wsgi.py
U       djangoProject/hello_django/manage.py

解决方案如下:

  • 首先 git status 查看下哪些没合并
lifeng@zx-047 MINGW64 /f/project_gitee/Test (master|MERGING)
$ git status
On branch master
Your branch is up to date with 'origin/master'.You have unmerged paths.(fix conflicts and run "git commit")(use "git merge --abort" to abort the merge)Changes to be committed:new file:   djangoProject/hello_django/hello_apps/__init__.pynew file:   djangoProject/hello_django/hello_apps/admin.pynew file:   djangoProject/hello_django/hello_apps/apps.pynew file:   djangoProject/hello_django/hello_apps/migrations/__init__.pynew file:   djangoProject/hello_django/hello_apps/models.pynew file:   djangoProject/hello_django/hello_apps/tests.pynew file:   djangoProject/hello_django/hello_apps/views.pynew file:   djangoProject/hello_django/hello_django/__init__.pynew file:   "document/testSpecification/\344\272\247\345\223\201\346\265\213\350\257\225\350\247\204\350\214\203.xlsx"new file:   document/testUseCaseDefectLibrary/case_library.mdnew file:   document/testUseCaseDefectLibrary/defects_library.mdnew file:   document/testUseCaseDefectLibrary/flowchart_template.mdnew file:   performance/locustProject/common/__init__.pynew file:   performance/locustProject/common/auth.pynew file:   performance/locustProject/common/config.pynew file:   performance/locustProject/locustfile.pynew file:   performance/locustProject/requirements.txtnew file:   requirements.txtUnmerged paths:(use "git add <file>..." to mark resolution)added by them:   djangoProject/hello_django/hello_django/asgi.pyadded by them:   djangoProject/hello_django/hello_django/settings.pyadded by them:   djangoProject/hello_django/hello_django/urls.pyadded by them:   djangoProject/hello_django/hello_django/wsgi.pyadded by them:   djangoProject/hello_django/manage.py
  • 其次执行下 git add   从新添加下;其次再 git commit -m' 注释信息 ';最后再 git push
lifeng@zx-047 MINGW64 /f/project_gitee/Test (master|MERGING)
$ git add *
The following paths are ignored by one of your .gitignore files:
venv
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"lifeng@zx-047 MINGW64 /f/project_gitee/Test (master|MERGING)
$ git commit -m'解决冲突文件'
[master 50712fc] 解决冲突文件lifeng@zx-047 MINGW64 /f/project_gitee/Test (master)
$ git push origin master
Enumerating objects: 1, done.
Counting objects: 100% (1/1), done.
Writing objects: 100% (1/1), 248 bytes | 248.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-5.0]
To gitee.com:lifeng0402/Test.git6673675..50712fc  master -> master

 

以上总结或许能帮助到你,或许帮助不到你,但还是希望能帮助到你,如有疑问、歧义,评论区留言会及时修正发布,谢谢!



未完,待续…

一直都在努力,希望您也是!

 

这篇关于解决error: Committing is not possible because you have unmerged files.的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/175169

相关文章

MyBatis模糊查询报错:ParserException: not supported.pos 问题解决

《MyBatis模糊查询报错:ParserException:notsupported.pos问题解决》本文主要介绍了MyBatis模糊查询报错:ParserException:notsuppo... 目录问题描述问题根源错误SQL解析逻辑深层原因分析三种解决方案方案一:使用CONCAT函数(推荐)方案二:

IntelliJ IDEA 中配置 Spring MVC 环境的详细步骤及问题解决

《IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决》:本文主要介绍IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决,本文分步骤结合实例给大... 目录步骤 1:创建 Maven Web 项目步骤 2:添加 Spring MVC 依赖1、保存后执行2、将新的依赖

Spring 中的循环引用问题解决方法

《Spring中的循环引用问题解决方法》:本文主要介绍Spring中的循环引用问题解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录什么是循环引用?循环依赖三级缓存解决循环依赖二级缓存三级缓存本章来聊聊Spring 中的循环引用问题该如何解决。这里聊

关于MongoDB图片URL存储异常问题以及解决

《关于MongoDB图片URL存储异常问题以及解决》:本文主要介绍关于MongoDB图片URL存储异常问题以及解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录MongoDB图片URL存储异常问题项目场景问题描述原因分析解决方案预防措施js总结MongoDB图

SpringBoot项目中报错The field screenShot exceeds its maximum permitted size of 1048576 bytes.的问题及解决

《SpringBoot项目中报错ThefieldscreenShotexceedsitsmaximumpermittedsizeof1048576bytes.的问题及解决》这篇文章... 目录项目场景问题描述原因分析解决方案总结项目场景javascript提示:项目相关背景:项目场景:基于Spring

解决Maven项目idea找不到本地仓库jar包问题以及使用mvn install:install-file

《解决Maven项目idea找不到本地仓库jar包问题以及使用mvninstall:install-file》:本文主要介绍解决Maven项目idea找不到本地仓库jar包问题以及使用mvnin... 目录Maven项目idea找不到本地仓库jar包以及使用mvn install:install-file基

最详细安装 PostgreSQL方法及常见问题解决

《最详细安装PostgreSQL方法及常见问题解决》:本文主要介绍最详细安装PostgreSQL方法及常见问题解决,介绍了在Windows系统上安装PostgreSQL及Linux系统上安装Po... 目录一、在 Windows 系统上安装 PostgreSQL1. 下载 PostgreSQL 安装包2.

Mysql如何解决死锁问题

《Mysql如何解决死锁问题》:本文主要介绍Mysql如何解决死锁问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录【一】mysql中锁分类和加锁情况【1】按锁的粒度分类全局锁表级锁行级锁【2】按锁的模式分类【二】加锁方式的影响因素【三】Mysql的死锁情况【1

SpringBoot内嵌Tomcat临时目录问题及解决

《SpringBoot内嵌Tomcat临时目录问题及解决》:本文主要介绍SpringBoot内嵌Tomcat临时目录问题及解决,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,... 目录SprinjavascriptgBoot内嵌Tomcat临时目录问题1.背景2.方案3.代码中配置t

如何解决idea的Module:‘:app‘platform‘android-32‘not found.问题

《如何解决idea的Module:‘:app‘platform‘android-32‘notfound.问题》:本文主要介绍如何解决idea的Module:‘:app‘platform‘andr... 目录idea的Module:‘:app‘pwww.chinasem.cnlatform‘android-32