本文主要是介绍解决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.的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!