use Winmerge inside of Git to file diff

前端 未结 8 1147
清酒与你
清酒与你 2020-11-27 09:34

Is there a way to use Winmerge inside of git to do Diffs?

8条回答
  •  猫巷女王i
    2020-11-27 10:00

    I have a script that will set the Diff and Merge tools in the Git config with the proper parameters that doesn't require a separate .sh file to exist. It seems to be working fine for me.

    git config --global diff.tool winmerge
    git config --global difftool.prompt false
    git config --global difftool.winmerge.cmd "\"\$PROGRAMFILES\"/WinMerge/WinMergeU.exe -r -u -e -dl \"Local\" -dr \"Remote\" \"\$LOCAL\" \"\$REMOTE\""
    
    git config --global merge.tool winmerge
    git config --global mergetool.prompt false
    git config --global mergetool.winmerge.trustExitCode true
    git config --global mergetool.winmerge.cmd "\"\$PROGRAMFILES\"/WinMerge/WinMergeU.exe -r -u -e -dl \"Local\" -dr \"Remote\" \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
    

    Note - the entire .cmd portion is quoted so that the parameters will be listed in the .gitconfig properly

提交回复
热议问题