git get conflicts from past merge without running merge once again

前端 未结 2 1371
谎友^
谎友^ 2021-02-19 09:46

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 t

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-19 10:31

    Yes, it is trivial. First of all, you need find sha1 id of the merge commit using git log. When you do the next:

    git checkout ^1
    git merge ^2
    

    you will be in a headless state. ^n means n-th parent of a commit. So, no branches are created. You could resolve conflicts again more carefully and then

    git diff HEAD..
    

    to see if there are any differences in the conflict resolutions.

    BTW, branch in a git just a human-friendly name for a sha1 of a commit, so don't afraid to create them as much as you wish.

    PS: If you work in Windows, ^ symbol in command line is special, you need to double it or quote command line arguments.

提交回复
热议问题