I have committed a big merge. Later, it appears that some files weren\'t merged correctly. I want to redo just these files, not the entire merge - the merge was big and I do
If you have already pushed the branch after merging, and you suspect that someone else may have pulled it, then you should avoid editing the merge commit. Instead, you are safest just fixing the files and making a new commit with those changes.
If this be not a concern, then you can try amending the merge commit, assumint that this merge commit is at the HEAD
of your branch. Just edit the files which were merged wrongly, test your code, and if you are satisfied, then do an amended commit via:
git commit --amend -m 'merge completed successfully'
If you now inspect your commit history via git log
, you will notice that the number of commits is the same as when you first completed the merge. But the latest commit is not the same as the first merge commit. Rather, it is a completely new commit with a new SHA-1 hash.