注:本文出自博主 Chloneda:個人博客 | 博客園 | Github | Gitee | 知乎
問題場景
今天進行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"
然后解決一下沖突就可以提交了!