I've merged two branches. Got lot's of conflicts. Resolved them all. Now I'm not sure, maybe I've made an error during conflict resolution. And I don't see no another way to check is it true — just run merge again, and check conflicts one by one.
This means I need to create one more branch to store results of my merge, right?
Can I avoid it? Maybe it's possible to get all conflicting files with all these <<<<<<
, ======
, >>>>>>
from somewhere in git, without running merge once again?
If you want to look at what the merge did you can do
git show <hash-of-merge-commit>
If you want to redo the entire merge you do
git checkout <branch-that-you-merged-to>
git reset --hard <hash-of-the-commit-just-before-the-merge>
git merge <branch-that-you-merged-in>
If you want to redo the merge and then compare the second merge to the first merge (to consider if it was better) you can do:
git checkout <branch-that-you-merged-to>
git rev-parse HEAD
This gives you the hash of the current commit. Note it down. Then do
git reset --hard <hash-of-the-commit-just-before-the-merge>
git merge <branch-that-you-merged-in>
Finish the merge, then do this to compare the merges
git difftool <hash-of-commit-noted-above>
If you felt that the original merge was better, you can do
git reset --hard <hash-of-commit-noted-above>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With