将 Notepad++ Compare 设置为 git 中的差异工具?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6950277/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Setting up Notepad++ Compare as the diff tool in git?
提问by bgcode
Is there an easy way to setup Notepad++'s Compare plugin as the diff tool for Git on Windows? I'm not sure whether it can be called from the command line so maybe not.
有没有一种简单的方法可以将 Notepad++ 的比较插件设置为 Windows 上 Git 的差异工具?我不确定是否可以从命令行调用它,所以也许不能。
采纳答案by ambagesia
As far as I know, Notepad++ doesn't allow custom command-line options for its plugins, so it would be a tad tricky to do so. You would need to create a wrapper script for it or call the executable directly. In my humble opinion, not worth it given that there are some very nice options for diff tools out there.
据我所知,Notepad++ 不允许为其插件使用自定义命令行选项,因此这样做会有点棘手。您需要为它创建一个包装脚本或直接调用可执行文件。以我的拙见,鉴于 diff 工具有一些非常好的选择,因此不值得。
In any case, git difftool
allows you to specify what exactly you'd like git to use for diff. You'll add this to your .gitconfig
file:
在任何情况下,都git difftool
允许您指定您希望 git 用于 diff 的确切内容。您将把它添加到您的.gitconfig
文件中:
[diff]
tool = araxis // enter your tool of choice here, Araxis is just an example
If you'd like to read more about it, here's a link to the man page: http://www.kernel.org/pub/software/scm/git/docs/git-difftool.html
如果您想阅读更多相关信息,请访问手册页的链接:http: //www.kernel.org/pub/software/scm/git/docs/git-difftool.html
回答by ufo
I've just posted a solution to a similar question over here. Btw, one of the main points in preferring N++ as a diff viewer is, for instance, that if you're anyway handling Git-managed code in N++, then you can always directly "Compare against GIT base" (v1.5.6.3!). Another reason is of course looking at a diff in a "real" editor with syntax highlighting and all the other well known goodies at hand.
我刚刚在这里发布了一个类似问题的解决方案。顺便说一句,喜欢 N++ 作为差异查看器的要点之一是,例如,如果您无论如何都在 N++ 中处理 Git 管理的代码,那么您总是可以直接“与 GIT 基础进行比较”(v1.5.6.3 !)。另一个原因当然是在具有语法突出显示和所有其他众所周知的好东西的“真实”编辑器中查看差异。