Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure git mergetool with Sublimerge

I configured my git to resolve merge conflicts with Sublimerge. For this, I was run:

git config --global merge.tool sublimerge

git config --global mergetool.sublimerge.cmd 'subl -n --wait \"$REMOTE\" \"$BASE\"   \"$LOCAL\" \"$MERGED\" --command \"sublimerge_diff_views\"'

git config --global mergetool.sublimerge.trustExitCode 'false'

git config --global diff.tool sublimerge

git config --global difftool.sublimerge.cmd 'subl -n --wait \"$REMOTE\" \"$LOCAL\" --command \"sublimerge_diff_views {\\\"left_read_only\\\": true, \\\"right_read_only\\\": true}\"'

When I run git mergetool, the Sublime will opening with four columns: .remote, .base, .local and the current file. But, all columns are empty.

And all columns names has a " after the file extension, like: file.php.REMOTE.44625.php", file.php.BASE.44625.php", file.php.LOCAL.44625.php"and file.php". Then i cant edit the conflict.

Anybody can help me?

like image 728
Mr-Cutia Avatar asked May 30 '14 17:05

Mr-Cutia


People also ask

How do I use Mergetool meld in git?

git mergetool allows you to use a GUI merge program (i.e. Meld) to resolve the merge conflicts that have occurred during a merge. Like difftool you can set the GUI program on the command line using -t <tool> / --tool=<tool> but, as before, it makes more sense to configure it in your . gitconfig file.

What is Mergetool in git?

DESCRIPTION. Use git mergetool to run one of several merge utilities to resolve merge conflicts. It is typically run after git merge. If one or more <file> parameters are given, the merge tool program will be run to resolve differences on each file (skipping those without conflicts).

How do I close git Mergetool?

Use :cquit , or git merge --abort and do the merge again.


1 Answers

In your ~/.gitconfig add following

[merge]
tool = sublimerge

[mergetool "sublimerge"]
cmd = subl -n --wait \"$REMOTE\" \"$BASE\" \"$LOCAL\" \"$MERGED\" --command \"sublimerge_diff_views\"
trustExitCode = false

[diff]
tool = sublimerge

[difftool "sublimerge"]
cmd = subl -n --wait \"$REMOTE\" \"$LOCAL\" --command \"sublimerge_diff_views {\\\"left_read_only\\\": true, \\\"right_read_only\\\": true}\"
like image 118
Aram Avatar answered Sep 30 '22 09:09

Aram