简体   繁体   English

配置:获取git数据,然后将其与git mergetool合并

[英]Config: Fetch git data then merge it with git mergetool

I've successfully set up Kaleidoscope as my default git difftool, and works like a charm. 我已经成功将万花筒设置为默认的git difftool,并且像超级按钮一样工作。 But when I make a fetch then git difftool, I can see what has changed, yet I cannot choose or merge what I want (at least not through Kaleidoscope). 但是,当我先获取git difftool时,我可以看到发生了什么变化,但是我无法选择或合并我想要的东西(至少不是通过万花筒)。

Now, I want to set up File Merge (the Merge app bundled with XCode) as my mergetool so I can fetch, see what has changed, and choose what to merge. 现在,我想成立文件合并(与XCode的捆绑合并应用程序)作为我的合并工具,所以我可以取回,看到发生了什么变化,以及选择什么样的合并。

Is this possible? 这可能吗? If so, how can I set this up? 如果是这样,我该如何设置?

My apologies in advance for a noobish question. 我事先对一个毫无疑问的问题表示歉意。

I use SourceGear's DiffMerge application for merging. 我使用SourceGear的DiffMerge应用程序进行合并。 It's much better than opendiff (the Xcode merge tool), and that's my recommendation for you. 它比opendiff(Xcode合并工具)要好得多,这是我对您的建议。 You can use the principles below to configure opendiff instead if you really want to, but it's much less powerful than DiffMerge. 如果确实愿意,可以使用以下原理来配置opendiff,但它的功能远不及DiffMerge。

My global git config file contains: 我的全局git配置文件包含:

[mergetool "diffmerge"]
        cmd = "diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$(if test -f \"$BASE\"; then echo \"$BASE\"; else echo \"$LOCAL\"; fi)\" \"$REMOTE\""
        trustExitCode = false
[merge]
        tool = diffmerge

So now when there are merges to do, I say "git mergetool" and it'll prompt me to launch DiffMerge for each file that needs merging. 因此,现在要进行合并时,我说“ git mergetool”,它将提示我为每个需要合并的文件启动DiffMerge。 I can choose from all the options for the file, save it into a resolved file, and go. 我可以从文件的所有选项中进行选择,将其保存到已解析的文件中,然后继续。 It's very nice. 这是很不错的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM