首页 > 其他 > 详细

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

时间:2019-10-31 00:19:36      阅读:423      评论:0      收藏:0      [点我收藏+]

:本文出自博主: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提交代码时有部分代码没有做好提交的准备。

解决方法

  1. 全部提交。
git commit -a
  1. 部分提交,可以通过添加 -i 参数。
git commit file -i -m "merge"

然后解决一下冲突就可以提交了!

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

原文:https://www.cnblogs.com/chloneda/p/git-commit-apart.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!