通过命令行在Sublime和Sublimerge中合并文件 [英] Merging files in Sublime with Sublimerge via command line

查看:374
本文介绍了通过命令行在Sublime和Sublimerge中合并文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到一个更好的合并文件选项,并希望在使用它进行工作时尝试Sublime.所以我安装了Sublimerge,现在卡住了.我知道我可以比较两个已经打开的文件,也可以通过补充工具栏进行比较,但是我想做的是通过命令行将其触发,这样就可以像其他所有合并工具一样从源代码控制程序中将其启动见过.有人知道命令行格式吗?

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 two already open files or compare via the Sidebar but what I want to do is fire it off via the command line so I can kick it off from our source control program like I can with every other merge tool I've seen. Does anyone know the command line format to do this?

N.B. -我已经放弃尝试使用sublime来处理合并,而是切换到其他工具来处理此问题了.因此,我从来没有感觉到我可以接受任何答案,因为我没有检查它们是否查看它们是否按照我想要的方式工作,或者是否确实可以正常工作.

推荐答案

正如Nickolay所建议的,这是您必须在~/.gitconfig中放置的整个指令:

As Nickolay already suggested, this is the whole directive you have to put in your ~/.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}\"

这篇关于通过命令行在Sublime和Sublimerge中合并文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆