GIT 2 or more merge conflicts in a single file - how p4merge handles?

后端 未结 1 903
轮回少年
轮回少年 2021-02-10 18:25
  1. GIT p4merge - 2 or more conflict in same file

I have integrated p4merge with GIT and i came across this situation once.

I have a file with merge con

1条回答
  •  死守一世寂寞
    2021-02-10 19:04

    1. My guess: when you save file in p4merge, it happilly return with code 0, file is changed, and git assumes that conflicts were resolved. There is a config parameter mergetool..trustExitCode (mergetool.p4merge.trustExitCode in your case), which can be set to false, so git will always ask you if merge was successfull after running git mergetool (which can be quite annoying). You also might be able to write a wrapper for p4merge which will check presence of conflict markers after running p4mege, or pre-commit hook, which rejects commits containing files containing such markers, though I've never done something like that.

    2. Yes, you can run git mergetool to resolve specified file. Learn more here.

    0 讨论(0)
提交回复
热议问题