Fatal: cannot do a partial commit during a merge

Fatal: cannot do a partial commit during a merge

This error occurs when submitting a single file, which means that the code cannot be partially submitted. The reason is that git thinks that some of your code is not ready to be submitted. For example, without adding

Solutions

1. Submit all

git commit -a

2. If you don’t want to submit all of them, you can do so by adding the – I option

git commit file/to/path -i -m "merge"

The above situation generally occurs when the local working copy conflict is resolved. After the local file is modified (manual merge), it is necessary to add and submit it, so that the local version is in the clean state. In this way, GIT pull will no longer report errors

Similar Posts: