解决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

相关文章

SpringBoot排查和解决JSON解析错误(400 Bad Request)的方法

《SpringBoot排查和解决JSON解析错误(400BadRequest)的方法》在开发SpringBootRESTfulAPI时,客户端与服务端的数据交互通常使用JSON格式,然而,JSON... 目录问题背景1. 问题描述2. 错误分析解决方案1. 手动重新输入jsON2. 使用工具清理JSON3.

MySQL 设置AUTO_INCREMENT 无效的问题解决

《MySQL设置AUTO_INCREMENT无效的问题解决》本文主要介绍了MySQL设置AUTO_INCREMENT无效的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参... 目录快速设置mysql的auto_increment参数一、修改 AUTO_INCREMENT 的值。

关于跨域无效的问题及解决(java后端方案)

《关于跨域无效的问题及解决(java后端方案)》:本文主要介绍关于跨域无效的问题及解决(java后端方案),具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录通用后端跨域方法1、@CrossOrigin 注解2、springboot2.0 实现WebMvcConfig

Go语言中泄漏缓冲区的问题解决

《Go语言中泄漏缓冲区的问题解决》缓冲区是一种常见的数据结构,常被用于在不同的并发单元之间传递数据,然而,若缓冲区使用不当,就可能引发泄漏缓冲区问题,本文就来介绍一下问题的解决,感兴趣的可以了解一下... 目录引言泄漏缓冲区的基本概念代码示例:泄漏缓冲区的产生项目场景:Web 服务器中的请求缓冲场景描述代码

解决JSONField、JsonProperty不生效的问题

《解决JSONField、JsonProperty不生效的问题》:本文主要介绍解决JSONField、JsonProperty不生效的问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑... 目录jsONField、JsonProperty不生效javascript问题排查总结JSONField

github打不开的问题分析及解决

《github打不开的问题分析及解决》:本文主要介绍github打不开的问题分析及解决,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、找到github.com域名解析的ip地址二、找到github.global.ssl.fastly.net网址解析的ip地址三

RedisTemplate默认序列化方式显示中文乱码的解决

《RedisTemplate默认序列化方式显示中文乱码的解决》本文主要介绍了SpringDataRedis默认使用JdkSerializationRedisSerializer导致数据乱码,文中通过示... 目录1. 问题原因2. 解决方案3. 配置类示例4. 配置说明5. 使用示例6. 验证存储结果7.

Swagger在java中的运用及常见问题解决

《Swagger在java中的运用及常见问题解决》Swagger插件是一款深受Java开发者喜爱的工具,它在前后端分离的开发模式下发挥着重要作用,:本文主要介绍Swagger在java中的运用及常... 目录前言1. Swagger 的主要功能1.1 交互式 API 文档1.2 客户端 SDK 生成1.3

java连接opcua的常见问题及解决方法

《java连接opcua的常见问题及解决方法》本文将使用EclipseMilo作为示例库,演示如何在Java中使用匿名、用户名密码以及证书加密三种方式连接到OPCUA服务器,若需要使用其他SDK,原理... 目录一、前言二、准备工作三、匿名方式连接3.1 匿名方式简介3.2 示例代码四、用户名密码方式连接4

如何解决Druid线程池Cause:java.sql.SQLRecoverableException:IO错误:Socket read timed out的问题

《如何解决Druid线程池Cause:java.sql.SQLRecoverableException:IO错误:Socketreadtimedout的问题》:本文主要介绍解决Druid线程... 目录异常信息触发场景找到版本发布更新的说明从版本更新信息可以看到该默认逻辑已经去除总结异常信息触发场景复