If git detects conflicts in a file it will always ask you to edit (or use a merge tool) to fix the conflicts. In this case you can fix it up however you like before staging it.
If git hasn't detected conflicts in a particular file but has detected conflicts elsewhere, then you can always fix that particular file and add the fixes (git add
) before making the merge commit.
In this case you can access the two different parent versions of the file via git show HEAD:path/to/file
and git show MERGE_HEAD:path/to/file
. You can redirect the git show
output to temporaries if you want to open them in an editor, say.
Once you've fixed up the file and resolved any other conflicts you can stage the fix (git add
) and make the merge commit (git commit
).
If git didn't detect any commits it will make the merge commit with no further prompts.
In this case you can still fix up your file. The two parent versions are accessible via git show HEAD:path/to/file
and git show HEAD^2:path/to/file
.
Once you've fixed up the file you can stage (git add
) and redo the merge commit with git commit --amend
.