[Git:commit错误] Fatal: cannot do a partial commit during a merge

Note : This article comes from bloggers: chloneda

Problem Scenario

Today conducted Spring Boot version upgrade, this error occurs when code files submitted for post-conflict.

上午11:56 Commit failed with error
        0 files committed, 5 files failed to commit: 升级Spring Boot版本,解决代码冲突。
        cannot do a partial commit during a merge.

The last line means that the part can not submit code. This is because there are parts of the code are not ready to submit when git commit code.

Solution

  1. All submitted.
git commit -a
  1. Part of the submission, by adding -i parameter.
git commit file -i -m "merge"

Then look at the conflict can be resolved submitted!

Guess you like

Origin www.cnblogs.com/chloneda/p/git-commit-apart.html