git 适用于 Linux 的 Visual SVN 差异和比较工具

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1141686/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 06:45:09  来源:igfitidea点击:

Visual SVN diff and compare tools for Linux

linuxsvngitdiff

提问by Lakshman Prasad

Which is the best Visual SVN Diff displayer for Linux.

哪个是适用于 Linux 的最佳 Visual SVN 差异显示器。

BeyondCompare and VisualSVN 1.5 work well on Windows. What are the equivalent tools for Linux? (Specifically Ubuntu).

BeyondCompare 和 VisualSVN 1.5 在 Windows 上运行良好。Linux 的等效工具是什么?(特别是 Ubuntu)。

I know command line diff works; But I'd like multiple column syntax highlighted and differences.

我知道命令行差异有效;但我想突出显示多列语法和差异。

Better if the tool has a support for Git and Hg as well.

如果该工具也支持 Git 和 Hg,那就更好了。

采纳答案by VonC

Note: If your diff tool has a CLI (a command line interface), it can be integrated with Git quite easily, both for diff and merge (if it supports 3-way merges).
Since Git1.6.3, the difftool- mergetooloptions allow you to integrate that diff program (see "How do I view 'git diff' output with visual diff program?").

注意:如果你的 diff 工具有一个 CLI(一个命令行界面),它可以很容易地与 Git 集成,用于 diff 和合并(如果它支持3 路合并)。
从 Git1.6.3 开始,difftool-mergetool选项允许您集成该 diff 程序(请参阅“如何git diff使用可视化 diff 程序查看 ' ' 输出?”)。

KDiff3for instance is a good candidate for that, since it is even auto-detected by Git.

例如KDiff3就是一个很好的候选者,因为它甚至可以被 Git 自动检测到

回答by Bjarke Freund-Hansen

I have been using meldfor this purpose, in Ubuntu you can just do:

我一直为此目的使用meld,在 Ubuntu 中你可以这样做:

apt-get install meld

I think it only does two-way compare, but usually that is only what you need, and only what the diff shows you anyway.

我认为它只进行双向比较,但通常这只是你需要的,而且也只是差异向你展示的。

When you get a conflict using SVN and have to do a merge, you usually get 4 files AFAIR.

当您使用 SVN 遇到冲突并且必须进行合并时,您通常会得到 4 个文件 AFAIR。

  • file.mine - The file with your local changes as before svn update.
  • file.r<n> - The revision on which you created your local changes.
  • file.r<n+m> - The revision you updated to from svn, usually HEAD.
  • file - Subversions attempt at merging your changes into the updated file.
  • file.mine - 与 svn update 之前的本地更改相同的文件。
  • file.r<n> - 您在其上创建本地更改的修订。
  • file.r<n+m> - 你从 svn 更新到的修订版,通常是 HEAD。
  • file - Subversions 尝试将您的更改合并到更新的文件中。

So to use meld to merge your changes in, you would do:

因此,要使用 meld 合并您的更改,您可以执行以下操作:

meld file.mine file.<n+m>

And merge either your changes into the revision updated from svn, or the other way around. It is usually easier to merge the file with the fewest changes to the file with most changes.

并将您的更改合并到从 svn 更新的修订版中,或者相反。将更改最少的文件合并到更改最多的文件通常更容易。

And last you would override file with the merged file and do a:

最后,您将使用合并文件覆盖文件并执行以下操作:

svn resolved file

回答by Lakshman Prasad

Diffusesupports Subversion, Mercurial, Git, and several other version control systems. It works on Windows too. For Ubuntu, just install the .deb package with "$ sudo dpkg -i diffuse-*.deb" and then run "diffuse -m" to view your changes or fix merge conflicts.

Diffuse支持 Subversion、Mercurial、Git 和其他几个版本控制系统。它也适用于 Windows。对于 Ubuntu,只需使用“$ sudo dpkg -idiffuse-*.deb”安装 .deb 包,然后运行“diffuse -m”以查看更改或修复合并冲突。

回答by Lasse V. Karlsen

Beyond Comparesupports Linux as well. If you already like BC for Windows, I'd say go with a winner.

Beyond Compare 也支持 Linux。如果您已经喜欢 Windows 版的 BC,我会说选择赢家。

回答by jeroenh

KDiff3 is very good (I also use it on windows). It works for both compare and merge.

KDiff3 非常好(我也在 Windows 上使用它)。它适用于比较和合并。

回答by Eric

I've used SlickEdit a lot on Linux. It has a pretty nice integrated diff viewer/editor. It works with SVN, CVS and a couple other version control repositories.

我在 Linux 上经常使用 SlickEdit。它有一个非常好的集成差异查看器/编辑器。它适用于 SVN、CVS 和其他几个版本控制存储库。

回答by Pascal MARTIN

What about kdiff(especially if you use KDE) Or, if you have an IDE (like Eclipse / netbeans), does it not provide SVN-related functionnalities ?

kdiff怎么(特别是如果你使用 KDE)或者,如果你有一个 IDE(比如 Eclipse/netbeans),它不提供与 SVN 相关的功能吗?

(I personnaly use Eclipse PDT for PHP ; and it's Subversive plugin for SVN)

(我个人对 PHP 使用 Eclipse PDT;它是 SVN 的 Subversive 插件)

回答by ephemient

I use Vim's diffmodefor this. With the vcscommandplugin, you can simply type :VCSDiffto enter diff-mode on the current file versus its history.

为此,我使用Vim 的diff模式。使用vcscommand插件,您可以简单:VCSDiff地输入当前文件与其历史记录的差异模式。

回答by Zeeshan Khan

Well.. did anyone try DiffMerge yet ? If not then I recommend all to do so. If you have used WinMerge for windows, then you will find this as a great alternative to WinMerge for Ubuntu / Linux.

嗯.. 有没有人尝试过 DiffMerge 呢?如果没有,那么我建议所有人都这样做。如果您在 Windows 上使用过 WinMerge,那么您会发现它是 WinMerge for Ubuntu / Linux 的绝佳替代品。

Try out the following web for details: http://www.webtechquery.com/index.php/2010/05/free-diff-tools-ubuntu-linux-windows/

有关详细信息,请尝试以下网站:http: //www.webtechquery.com/index.php/2010/05/free-diff-tools-ubuntu-linux-windows/

Thanks

谢谢

回答by Jiqing Tang

You may want to try out xd http://github.com/jiqingtang/xd, which is GUI wrapper for GIT/SVN diff. It is NOT a diff tool itself. You run "xd" when you want to run "git diff" or "svn diff" and it will show you a list of files, a preview window and you can launch any diff tool you like, including tkdiff, xxdiff, gvimdiff, emacs(ediff), xemacs(ediff), meld, diffuse, kompare and kdiff3. You can also run any custom tool.

您可能想尝试 xd http://github.com/jiqingtang/xd,它是 GIT/SVN diff 的 GUI 包装器。它本身不是一个差异工具。当您想运行“git diff”或“svn diff”时运行“xd”,它会向您显示文件列表、预览窗口,您可以启动任何您喜欢的差异工具,包括 tkdiff、xxdiff、gvimdiff、emacs (ediff)、xemacs(ediff)、meld、diffuse、kompare 和 kdiff3。您还可以运行任何自定义工具。