Merging files in Sublime with Sublimerge via command line

前端 未结 4 1017
栀梦
栀梦 2021-01-02 00:08

I\'m trying to find a better merge file option and wanted to try out Sublime as of my work is done using it. so I installed Sublimerge and now am stuck. I know I can compare

4条回答
  •  情深已故
    2021-01-02 00:42

    Taking jnns' answer, but making appropriate changes for windows.

    %USERPROFILE%\.gitconfig:

    [merge]
        tool = sublimerge
    
    [mergetool "sublimerge"]
        cmd = sublime_text -n --wait \"$REMOTE\" \"$BASE\" \"$LOCAL\" \"$MERGED\" --command \"sublimerge_diff_views\"
        trustExitCode = false
    
    [diff]
        tool = sublimerge
    
    [difftool "sublimerge"]
        cmd = sublime_text -n --wait \"$REMOTE\" \"$LOCAL\" --command \"sublimerge_diff_views {\\\"left_read_only\\\": true, \\\"right_read_only\\\": true}\"
    
    • note location of .gitconfig
    • in windows, the executable is sublime_text.exe, NOT subl
    • don't forget to add sublime text executable to the path

提交回复
热议问题