合并后提交Git错误 - 致命:在合并期间无法执行部分提交 [英] Git error on commit after merge - fatal: cannot do a partial commit during a merge

查看:1845
本文介绍了合并后提交Git错误 - 致命:在合并期间无法执行部分提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行了一个以code> git pull 结尾的冲突。我解决了冲突,现在一切正常(我也使用了mergetool)。

当我用提交解析文件时git commit file.php - mmessage我得到错误:

 致命:无法在合并期间进行部分提交。 

之前我有同样的问题,使用 -a

解决方案

问题对我来说。 -i基本上告诉它在提交之前放置额外的文件。
这就是:

$ p $ git commit -i myfile.php


I ran a git pull that ended in a conflict. I resolved the conflict and everything is fine now (I used mergetool also).

When I commit the resolved file with git commit file.php -m "message" I get the error:

fatal: cannot do a partial commit during a merge.

I had the same issue before and using -a in commit worked perfectly. I think it's not the perfect way because I don't want to commit all changes. I want to commit files separately with separate comments. How can I do that? Why doesn't git allow users to commit files separately after a merge? I could not find a satisfactory answer to this problem.

解决方案

I found that adding "-i" to the commit command fixes this problem for me. The -i basically tells it to stage additional files before committing. That is:

git commit -i myfile.php

这篇关于合并后提交Git错误 - 致命:在合并期间无法执行部分提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆