gpt4 book ai didi

git - 使用 Sublimerge 配置 git mergetool

转载 作者:太空狗 更新时间:2023-10-29 13:01:09 25 4
gpt4 key购买 nike

我配置我的 git 来解决与 Sublimerge 的 merge 冲突。为此,我跑了:

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”。然后我无法编辑冲突。

谁能帮帮我?

最佳答案

在你的 ~/.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}\"

关于git - 使用 Sublimerge 配置 git mergetool,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23960660/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com