合并后提交Git错误 - 致命:在合并期间无法执行部分提交 [英] Git error on commit after merge - fatal: cannot do a partial commit during a merge
问题描述
我运行了一个以code> git pull 结尾的冲突。我解决了冲突,现在一切正常(我也使用了mergetool)。
当我用提交解析文件时git commit file.php - mmessage
我得到错误:
致命:无法在合并期间进行部分提交。
之前我有同样的问题,使用 -a $ c $在提交工作完美。我认为这不是完美的方式,因为我不想承诺所有更改。我想用单独的注释分别提交文件。我怎样才能做到这一点?为什么git不允许用户在合并后单独提交文件?我找不到满意的答案。
问题对我来说。 -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屋!