Winmerge教程,包括可视化补丁,差异,合并示例

Linux operating system have different tools to find diff and create patches. Windows operating system do not provide any builtin tool for these operations. But there is a 3 party application which can be used easily and freely called Winmerge.

Linux操作系统具有不同的工具来查找差异并创建补丁。 Windows操作系统不提供用于这些操作的任何内置工具。 但是有一个3方应用程序,可以轻松免费使用它,称为Winmerge。

下载及安装 (Download and Installation)

The winmerge tool can be downloaded from following link.

可以从以下链接下载winmerge工具。

https://downloads.sourceforge.net/project/winmerge/stable/2.14.0/WinMerge-2.14.0-Setup.exe

https://downloads.sourceforge.net/project/winmerge/stable/2.14.0/WinMerge-2.14.0-Setup.exe

After download is completed the installation can be done with Next-Next style.

下载完成后,可以使用Next-Next样式进行安装。

比较两个文件 (Compare Two Files)

One of the most used function of the winmerge is comparing two files. We can compare two files with the Open button which is in tool bar like below.

Winmerge最常用的功能之一是比较两个文件。 我们可以使用下面工具栏中的“ Open按钮来比较两个文件。

Winmerge教程,包括可视化补丁,差异,合并示例
Compare Two Files
比较两个文件

Now we will select the two files those will be compared with each other. In this example file names are user.txt and users_new.txt . The can can be same if the location is different for both files.

现在,我们将选择两个文件进行比较。 在此示例中,文件名是user.txtusers_new.txt 。 如果两个文件的位置都不同,则可以相同。

Winmerge教程,包括可视化补丁,差异,合并示例
Compare Two Files
比较两个文件

Then we click OK and following screen will appear. This screen show different lines in yellow color for both files. There is also an visual navigator which shows location of the different files in a straight bar.

然后我们单击OK ,将出现以下屏幕。 该屏幕以黄色显示两个文件的不同行。 还有一个可视化的导航器,以直条显示不同文件的位置。

Winmerge教程,包括可视化补丁,差异,合并示例
Difference of Two Files
两个文件的区别

比较文件夹(Compare Folders)

We can also compare folders too. This will create files and folder names which do not exist other input. As we can see that there is also an Filter part where we can provide some filter expression like we do only compare folders those names start with TEST .

我们也可以比较文件夹。 这将创建不存在其他输入的文件和文件夹名称。 如我们所见,还有一个Filter部分,我们可以在其中提供一些过滤器表达式,就像我们只比较那些以TEST开头的文件夹一样。

Winmerge教程,包括可视化补丁,差异,合并示例
Compare Folders
比较文件夹

包括子文件夹(Include Sub Folder)

By default only given right and left value folders will be compared. But we can enable to sub files and folders to compare and diff with the Include Subfolders option like below.

默认情况下,仅比较给定的左右值文件夹。 但是我们可以通过如下所示的“ Include Subfolders选项来使子文件和文件夹进行比较和比较。

了解更多Linux Bash目录和更改当前的工作路径
Winmerge教程,包括可视化补丁,差异,合并示例
Include Sub Folder
包括子文件夹

翻译自: https://www.poftut.com/winmerge-tutorial-with-examples-to-visual-patch-diff-merge/