0 votes
1 view
in Devops and Agile by (19.8k points)

I ran a git pull that ended in conflict. I resolved the conflict and everything is fine now (I used merge tool also).

When I commit the resolved file with  git commit file.php -m "message"  I get the error:

fatal: cannot do a partial commit during a merge.

I had the same issue before and using  -a in commit worked perfectly. I think it's not the perfect way because I don't want to commit all changes. I want to commit files separately with separate comments. How can I do that? Why doesn't git allow users to commit files separately after a merge? I could not find a satisfactory answer to this problem.

1 Answer

+1 vote
by (63.4k points)

By adding "-i" to the commit command would fix this problem for you. Basically, in simple terms the -i tells git to stage additional files before committing them without explicitly using the git add command, like this:

git commit -i myfile.php

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...