[Git:commit错误] Fatal: cannot do a partial commit during a merge
时间:2019-10-31 00:19:36
收藏:0
阅读:424
注:本文出自博主:chloneda
问题场景
今天进行Spring Boot版本升级,解决冲突后进行代码文件提交时出现这个错误。
上午11:56 Commit failed with error
0 files committed, 5 files failed to commit: 升级Spring Boot版本,解决代码冲突。
cannot do a partial commit during a merge.
其中最后一行的意思是不能部分提交代码。这是因为git提交代码时有部分代码没有做好提交的准备。
解决方法
- 全部提交。
git commit -a
- 部分提交,可以通过添加 -i 参数。
git commit file -i -m "merge"
然后解决一下冲突就可以提交了!
原文:https://www.cnblogs.com/chloneda/p/git-commit-apart.html
评论(0)