我配置了我的git来解决与Sublimerge的合并冲突。为此,我运行:
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}\"'当我运行git mergetool时,Sublime将打开四列:.remote、.base、.local和当前文件。但是,所有列都是空的。
并且所有列的名称都有一个“文件扩展名后,如: file.php.REMOTE.44625.php”、“file.php.BASE.44625.php”、“file.php.LOCAL.44625.php”和“file.php”,则无法编辑冲突。
有人能帮我吗?
发布于 2015-07-15 04:44:39
在~/.gitconfig中添加以下内容
[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}\"发布于 2017-08-20 01:57:06
添加git合并工具作为sublime编辑器后,然后验证~/.gitconfig文件。
$git config --list
user.email=xyz@live.com
user.name=xyz
color.ui=true
color.status=auto
color.branch=auto
push.default=matching
branch.autosetuprebase=always
core.editor=subl -n -w
merge.tool=sublimerge
mergetool.sublimerge.cmd=subl -n --wait \"$REMOTE\" \"$BASE\" \"$LOCAL\" \"$MERGED\" --command \"sublimerge_diff_views\"
mergetool.sublimerge.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}\"如果未反映,则手动添加合并工具详细信息
$vim ~/.gitconfig
[core]
editor = subl -n -w
[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}\\\"https://stackoverflow.com/questions/23960660
复制相似问题