(转)[GIT]Fatal: cannot do a partial commit during a merge

Reprinted from: https://blog.csdn.net/iefreer/article/details/7697799

I get this error when submitting a single file.

This means that the code cannot be partially submitted.

 

The reason is that git thinks that you have some code that is not ready for submission, such as not adding

 

The workaround is

1. Submit all

git commit -a

 

2. If you don't want to submit all, you can add the -i option

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

 

The above situation generally occurs when solving local working copy conflicts. After the local file modification (manual merge) is completed, it needs to be added and submitted, so that the local version is in a clean state.

In this way, git pull will no longer report errors in the future.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326116556&siteId=291194637