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

相关文章

Java中读取YAML文件配置信息常见问题及解决方法

《Java中读取YAML文件配置信息常见问题及解决方法》:本文主要介绍Java中读取YAML文件配置信息常见问题及解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要... 目录1 使用Spring Boot的@ConfigurationProperties2. 使用@Valu

SQL Server配置管理器无法打开的四种解决方法

《SQLServer配置管理器无法打开的四种解决方法》本文总结了SQLServer配置管理器无法打开的四种解决方法,文中通过图文示例介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的... 目录方法一:桌面图标进入方法二:运行窗口进入检查版本号对照表php方法三:查找文件路径方法四:检查 S

Redis出现中文乱码的问题及解决

《Redis出现中文乱码的问题及解决》:本文主要介绍Redis出现中文乱码的问题及解决,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1. 问题的产生2China编程. 问题的解决redihttp://www.chinasem.cns数据进制问题的解决中文乱码问题解决总结

Python中Tensorflow无法调用GPU问题的解决方法

《Python中Tensorflow无法调用GPU问题的解决方法》文章详解如何解决TensorFlow在Windows无法识别GPU的问题,需降级至2.10版本,安装匹配CUDA11.2和cuDNN... 当用以下代码查看GPU数量时,gpuspython返回的是一个空列表,说明tensorflow没有找到

解决未解析的依赖项:‘net.sf.json-lib:json-lib:jar:2.4‘问题

《解决未解析的依赖项:‘net.sf.json-lib:json-lib:jar:2.4‘问题》:本文主要介绍解决未解析的依赖项:‘net.sf.json-lib:json-lib:jar:2.4... 目录未解析的依赖项:‘net.sf.json-lib:json-lib:jar:2.4‘打开pom.XM

XML重复查询一条Sql语句的解决方法

《XML重复查询一条Sql语句的解决方法》文章分析了XML重复查询与日志失效问题,指出因DTO缺少@Data注解导致日志无法格式化、空指针风险及参数穿透,进而引发性能灾难,解决方案为在Controll... 目录一、核心问题:从SQL重复执行到日志失效二、根因剖析:DTO断裂引发的级联故障三、解决方案:修复

IDEA Maven提示:未解析的依赖项的问题及解决

《IDEAMaven提示:未解析的依赖项的问题及解决》:本文主要介绍IDEAMaven提示:未解析的依赖项的问题及解决,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝... 目录IDEA Maven提示:未解析的依编程赖项例如总结IDEA Maven提示:未解析的依赖项例如

解决Entity Framework中自增主键的问题

《解决EntityFramework中自增主键的问题》:本文主要介绍解决EntityFramework中自增主键的问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝... 目录Entity Framework中自增主键问题解决办法1解决办法2解决办法3总结Entity Fram

Nginx 配置跨域的实现及常见问题解决

《Nginx配置跨域的实现及常见问题解决》本文主要介绍了Nginx配置跨域的实现及常见问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来... 目录1. 跨域1.1 同源策略1.2 跨域资源共享(CORS)2. Nginx 配置跨域的场景2.1

qt5cored.dll报错怎么解决? 电脑qt5cored.dll文件丢失修复技巧

《qt5cored.dll报错怎么解决?电脑qt5cored.dll文件丢失修复技巧》在进行软件安装或运行程序时,有时会遇到由于找不到qt5core.dll,无法继续执行代码,这个问题可能是由于该文... 遇到qt5cored.dll文件错误时,可能会导致基于 Qt 开发的应用程序无法正常运行或启动。这种错