WinMerge 2.8 Manual

Kimmo Varis

Dean Grimm

Laurent Ganier

Tim Gerundt

Perry Rapp

and all others who helped with this.

Revision 1.3.14

Copyright © 2004-2008 Thingamahoochie Software.

Information in this document is subject to change without notice. Other products and companies referred to herein are trademarks or registered trademarks of their respective companies or mark holders.

1. About This Document

This is a manual for WinMerge 2.8.

This manual is recommended reading for experienced and new users of WinMerge 2.8. Reading this manual will help ensure the user knows about the various functions available in WinMerge, and various limitations.

Please read at least the following chapters:

  • The Quick start chapter will get you quickly started with WinMerge. After reading this chapter you will know the basic usage of WinMerge.
  • The Comparing Folders chapter explains folder comparison, ways to change the results display, and operations available in the folder comparison window.
  • The Comparing Files chapter explains the file comparison/merge window, its various panes, and methods of navigation, modes, and operations available in this window.
  • The Options and Configuration chapter helps to customize WinMerge to your needs, including things such as whitespace handling, colors, and handling text encoding.

The following chapters are suggested reading for more efficient use of WinMerge:

  • The Opening Files and Folders chapter introduces several ways (there are many!) to open files and folders to WinMerge. For example, do you know how to use the Shell Extension context menu in advanced mode?
  • The Plugins chapter introduces plugins.
  • The Filters chapter explains the use of both file filters and line filters.
  • The Commandline chapter lists commandline parameters for WinMerge (for using with other tools, or from a script).
  • The FAQ chapter contains answers to many common questions asked of developers. Please check first if your question is answered there before submitting questions to SourceForge.net.


2. Quick Start

2.1. Opening Files and Folders

Start WinMerge and either select Open from the File-menu, or click the yellow folder icon on the toolbar, or press Ctrl-O. The file/folder selection dialog opens:

Two topmost fields in Open dialog are for selecting files and folders to compare. Comparison objects can be specified in one of four ways:

  1. Enter the path names directly into the edit fields
  2. Click the Browse button and use the file chooser to navigate to the desired path
  3. Expand the combo box and select a previously used path
  4. Drag & drop path into the edit field from Explorer

If Open-dialog Auto-completion -option is enabled in options WinMerge shows a list of paths available when typing into the fields. Auto-completion can be restricted to earlier used paths only, which makes selecting frequently used paths fast.

Folder can be selected from Windows Open dialog (opens when Browse-button is selected) by browsing into folder and selecting Open-button. It does not require selecting a file. When Filename field in Windows Open dialog contains text "Folder Selection" selecting Open button selects currently visible folder. Also if filename in Windows Open dialog does not match any real file parent folder is selected. Open dialog always shows backslash "\" at end of folder name.

[Note] Note

There can be only file & file or folder & folder selected to open for compare. If there is file & folder or other one of files/folders cannot be found WinMerge disables OK-button in dialog.

Filter field can be used to select files by extension to compare. Default value is "*.*" which includes all files. But listing one or more extensions restricts compare to only files with those extensions. Multiple extensions are separated with space or semicolon. For example, entering the file filter *.cpp;*.hpp;*.c;*.h will cause WinMerge to ignore all files except C and C++ source files. You can only filter by file extension, not by filename.

File filters are a much more powerful way (than extension filters) to select files and folders. Use the Select button next to the Filters field to see a list of available filters, and to choose a file filter to use.

If the Include Subfolders checkbox is checked then WinMerge compares all subfolders and shows all files and folders it finds in one view. Otherwise only the current folder is compared, and subfolders are listed by name (without their contents), so the user can browse into them.

Unpacker selection is for plugins.

[Tip] Tip

Status of currently selected files or folders is shown with text in bottom of the dialog. If one of the paths is invalid this text tells which one it is.

Project files are the easiest and fastest way to open frequently used paths. Usually project files are opened using separate dialog accessible from File-menu. A project file can be also selected as left path in Open-dialog. Selecting project files to Left- and Right-paths WinMerge compares selected project files. See Opening Files and Folders for more information about project files.

2.1.1. Other Ways to Open Files and Folders

Open-dialog is the main interface for opening files and folders. But WinMerge allows many other ways too:

  • Shell integration allows selecting files and folders to compare from Windows Explorer
  • Command-line allows starting WinMerge from other applications, command prompt or batch/script file
  • Files and folders can be drag&drop'ed directly to WinMerge window
  • Project-file can be opened from command-line or from File->Open Project... -menuitem

2.2. Comparing Folders

If two folders were selected in the Open dialog then the folder compare window is opened. Folder compare is basically a list of found items. Found file- and folder-names are shown in rightmost column and other columns show other related information.

WinMerge does not have a concept of "original" and "changed" sides. WinMerge just shows what is different between two selected folders. This is especially the case for files and folders that are found only in other side. WinMerge does not show them as "added" or "removed" but unique items.

Using Merge menu items, toolbar items, or context menu items, files and folders can be managed in many ways. Most important action is making files and folders identical in both sides. This is done by selecting one of several Copy -items. When file or folder is copied to other side it becomes identical.

If the selected file exists in both sides (and it is not a binary file) it can be opened to file compare. File can be opened by:

  1. selecting Compare from Merge menu
  2. selecting Compare from context menu
  3. double-clicking with mouse
  4. pressing Enter key

After file compare is closed file's status is updated to folder compare.

2.3. Comparing Files

File compare shows two files side by side. Different lines are highlighted with background color. One or more consecutive different lines form one difference (or "diff"). WinMerge mostly works with these differences, not separate lines.

[Important] Important

Notice how WinMerge fills missing lines in other side. Similar lines are always side by side. This is different from most other compare/merge programs and can take a while to learn.

With merging commands (in Merge menu) lines in difference can be copied between sides. Missing lines can be copied also. When missing lines are copied from one side to another, matching existing lines are removed. In the above screenshot, copying lines in second difference from the left to the right would remove matching lines from the left side.

WinMerge has an simple integrated editor. Typing, copying, cutting and pasting text works. If Automatic rescan is enabled then WinMerge updates file differences while files are edited. If Automatic rescan is disabled files can be updated selecting Refresh from Edit-menu, clicking toolbar button with two yellow arrows or pressing F5 key.


3. Introduction to WinMerge

WinMerge is an Open Source visual text file differencing and merging tool for Windows. WinMerge can compare folders and files and present differences in easy to understand and handle format.

WinMerge is highly useful for determining what has changed between project versions, and then merging changes between versions. WinMerge can be used as external differencing/merging tool or as standalone application.

In addition WinMerge has a lot of helping and supporting features making comparing and synching/merging as easy and useful as possible. Several programming languages and other fileformats are syntax highlighted.

WinMerge is not an hex-editor. WinMerge can show binary files contents and differences in them. But that information is meant for viewing only, and editing binary files with WinMerge can break the files.

Goal of WinMerge development is to make comparing and synch/merge of folders and files easy and fast. While maintaining maximum reliability. Easy of use reduces errors. Latest 2.8 version is considered a stable and reliable program to use.

Please note that WinMerge is not a freeware (unlike lots of sites in web say), but it is GPL licenced. We have given you a good tool for free, so please follow our licence and submit your improvements back to us. We are happy to get help improving WinMerge further. It is advantage for all WinMerge users.

3.1. WinMerge Versions

There are three kind of versions available in downloads page.

3.1.1. Stable Versions

Stable versions are recommended for most users. If you are unsure about what version to use - use latest stable version. Stable versions have even second number, for example 2.4, 2.6 and 2.8.

3.1.2. Beta Versions

Beta versions are for people who want to test latest features and improvements done after last stable version. Beta versions are not so extensively tested as stable versions are and probably have some bugs. Beta versions have odd second number, for example 2.5 and 2.7. Beta versions can be used in production, they are not expected to have major bugs. But there is always a risk with using beta-level release, so consider it carefully. We have tried to release new stable series once a year, so it may be worth waiting for few months for next stable release...

3.1.3. Experimental Versions

Experimental versions are snapshot releases from version control (Subversion). They have all the latest features and improvements. Some features may still be buggy and/or incomplete. These releases are made available to allow users to try out the current code without needing to compile, and participate in development discussions concerning new and changing features. We also appreciate any help testing the current code. Use with care and enable backups! And please report bugs you find using these builds, it really helps with WinMerge development!

3.1.4. Version Tree

All this text about different versions may sound confusing if you never have worked with this kind of model. Lets see this with picture below:

WinMerge stable and development versions

This picture presents how our releases and different versions relate to each other. Development always happens with development versions (experimental versions and beta versions). At proper points we create a new branch for stable releases. In above picture arrows for 2.2.x and 2.4.x are two current stable branches. Picture does not show 2.6 which is the latest stable branch.

[Important] Important

Branch always means a separate development. There is no any automation to copy improvements or fixes from development versions to stable versions. Or in opposite direction. Changes are always selected by hand and then merged (with WinMerge, of course..).

After a branch is created, we try to keep code in it as stable as possible. Usually this means we copy only tested bugfixes from development versions to stable versions. Unfortunately this is not always an easy task and errors can happen. And new bugs appear also in stable versions sometimes. It is just a real-life software development. However, in general quality in branches increases and 2.6.14 is better release than 2.4.0, and using the latest stable branch release is always recommended.

What this branching also means is that stable versions don't get many new features after a branch is created. Stable versions 2.6.0 and 2.6.14 are pretty much similar feature-wise. After 2.6 stable branch we have already a created new stable branch 2.8. It has many improvements and fixes done after 2.6 branch was created.

Many software vendors always increase their version numbers and say version with biggest version number is what people should use. If WinMerge was developed as closed-source software users would see only versions from stable branches and that would be true for WinMerge too. But as WinMerge is an open source software project we want to keep our development as open as possible. And do a lots of development version releases. The latest development version can have version number 2.9.1.0 and the latest stable version can have version number 2.6.14.

3.2. Getting Support and Reporting Bugs

Open discussion forum is the fastest way to get help. Please be patient, it may take some time anybody answers.

If you have found a bug, please submit it as a bug report. Please attach as much information as you can, at least the version number of WinMerge you are using. If you can, attach also configuration log which you can see from menu Help->Configuration... Good information in bug report means better change for bug to be fixed faster.

[Important] Important

Include version number in bug reports. Version number can be checked from Help->About WinMerge dialog.

We prefer that you register with Sourceforge.Net before posting a bug report (registration is public and free), so that you may get email notifications if we post follow-up questions to your bug. It is not at this time required that you register to post a bug report (although, we do generally give less priority to unregistered bug reports, because it has been our experience that unregistered posters often do not remember to return and check to answer follow-on questions).

3.3. WinMerge Source Codes and Development

WinMerge source codes are available in downloads page and from public Subversion server. We welcome everybody to download the sources, study them and alter them. If you find (and fix) bugs, improve something etc, please submit your changes back to us as patches and help improve this product! If you publish your altered version, you are required to publish changes source code too, it is what GPL licence is about. Please respect it.

While WinMerge development has been fast in last couple of years, all this work is done by people in their spare time. Nobody gets paid for improving WinMerge. We try to fix bugs as we find them or somebody reports them to us. We really try - we use WinMerge too. But there is absolutely no promises for new features. We always appreciate any help with WinMerge, be it testing, documenting, translating or coding.

3.3.1. Participating to WinMerge Development

As mentioned above, we look for help in many areas, not just coding. Translations, documentation and testing are important too.

The Developers-Wiki is a good source of information if you want to help with WinMerge development. There is a Help Needed -page in the wiki for more information about how to help with WinMerge development.

Development-mailing list is the preferred place for development discussions. Another place is in Developers-forum. If you are interested in helping with WinMerge development, let us know. If you want to fix one of our bugs or implement a new feature, let us know.


4. Getting and Installing WinMerge

WinMerge can be installed using installer or by unzipping files from archive. Using the installer is the recommended method.

[Note] Note

Currently WinMerge installer works natively only for 32-bit Windows. There is no separate version of WinMerge for 64-bit Windows (WinXP/2003/Vista). 64-bit Windows versions can run the installer and WinMerge as 32-bit application. For the Shell Integration there is the 64-bit version of extension included in the installer.

4.1. Getting Files

Latest releases can be always downloaded from WinMerge homepage: WinMerge.org. Note that there may be some delay updating homepages for the latest releases, but project statuspage at SourceForge.net shows the latest files. There is also a mailing-list for release announcements. Stable releases are also available in several file download sites.

4.2. Using the Installer (recommended)

[Note] Note

Installer requires Admin-user privileges in Windows NT4/2000/XP. If you don't have Admin-user privileges you can install WinMerge by unzipping from an archive file (see Installing from an Archive).

This is recommended for most users. Installer asks location where WinMerge is installed, installs files, configures shell integration and adds WinMerge to Start-menu. To install WinMerge:

  1. Start installer executable (usually named WinMerge-version-setup.exe)
  2. Select Next-button in welcome screen
  3. Select Next-button in licence screen
  4. Select location for WinMerge and select Next-button. It is recommended to install WinMerge in own folder.

  5. Select components installed or one of pre-configured combinations. Typical configuration is recommended for most users. In addition to components already selected by Typical, language file(s) could be chosen. Components are:

    • WinMerge core files - cannot be unselected - WinMerge executable, user's guide and other needed files
    • Filters - file filter files
    • Plugins - plugins and scripts
    • Languages - WinMerge translation files. After installing translation file user interface language can be selected from menu View->Language.
  6. Select Start-menu folder or disable creating it.

  7. Select additional tasks:

    • Enable Explorer context menu integration - Enables basic WinMerge shell integration (can be later enabled from options).
    • Integrate with TortoiseCVS - sets WinMerge to TortoiseCVS diff application.
    • Integrate with TortoiseSVN - sets WinMerge to TortoiseSVN diff application.
    • Integrate with ClearCase - sets WinMerge to ClearCase diff and merge application.
    • Create a Desktop Icon - adds WinMerge icon to Desktop.
    • Create a Quick Launch Icon - adds WinMerge icon to Quick Launch bar.
  8. Verify install selections and select Install button to continue.
  9. After installer has copied files final screen appears with two checkboxes asking if created WinMerge Start-menu folder should be opened and if WinMerge application should be started.

4.3. Installing from an Archive

WinMerge is pretty much independent from other system components. It doesn't integrate tightly to Windows or use lots of DLLs. WinMerge[U].exe itself is dependent of MFC71[U].dll , MSVCR71.dll and MSVCP71.dll in addition to some system DLLs. So if mentioned DLLs already are installed to system, only WinMerge[U].exe is needed to run WinMerge. Mentioned DLL files are available also as Runtimes-package to download.

[Note] Note

WinMerge 2.6.0 and later versions require a new version of runtime libraries. When updating from older WinMerge versions using archive files, new runtime files form Runtime-package are needed.

Archive files have correct folder structure. WinMerge should be unzipped preserving folder structure to destination folder, for example C:\Program Files\. Root folder created has name /WinMerge-version, for example /WinMerge-2.6.0. This folder can be renamed or files copied to other folder (preserving the folder structure!).

After unzipping files WinMerge is ready to run! Shell Integration and Archive Integration may need additional steps (see below).

4.4. Shell Integration

Choose "Enable Explorer context menu integration" from installer's additional features to install Shell Integration.

If install program is not used, Shell Integration DLL (ShellExtension*.dll) must be registered separately. This is done by running register.bat from WinMerge directory. Restarting the computer is recommended after installing Shell Integration so that Windows updates all its references.

[Note] Note

Installing shell Integration requires administrative user privileges.

Updating the Shell Integration outside the installer requires first uninstalling current Shell Integration version. Uninstalling can be done by running unregister.bat from WinMerge directory. After that the computer should be restarted so Windows completes uninstallation. Then the new version can be installed like described above.

4.4.1. 64-Bit Shell Integration

WinMerge version 2.6 includes a partial support for 64-bit Windows versions by including 64-bit Shell Integration. WinMerge installer recognizes 64-bit versions of Windows and can install correct version of Shell Integration.

When installing Shell Integration by hand from an archive file, Shell Integration DLL is named as ShellExtensionX64.dll. Registering/unregistering can be done with register.bat and unregister.bat like with 32-bit versions.

4.5. 7-Zip and Archive Support

WinMerge uses 7-Zip for archive support, but WinMerge installer does not install 7-Zip or archive support. Installing 7-Zip application is recommended but not required for archive support. 7-Zip installer can be downloaded from 7-Zip.org.

[Important] Important

There are 7-Zip MSI installers that do not install all the files WinMerge needs (namely 7zip_pad.xml in 7-Zip program folder). If there are problems with archive support enabling, try running the EXE version of the 7-Zip installer.

To install archive support, download and install 7-Zip plugin (Merge7zInstaller, see below) from WinMerge.org.

WinMerge automatically detects installed 7-zip in system, there is no need to any configuration.

7-zip integration needs compatible Merge7z*.dll file in WinMerge program directory. * comes from 7-Zip version installed. For example 7-Zip version 4.42 needs Merge7z442.dll. And if WinMergeU.exe (Unicode version) is used, then "U" is also added to filename: Merge7z442U.dll. If needed DLL file is for some reason missing it can be copied to WinMerge directory, for example from 7z-Plugin archive downloadable in WinMerge download page.

If Merge7z*.dll file is missing, WinMerge informs user with message showing filename of needed file and recommended version of 7-Zip. This message can also be opened from Help-menu item "Archive Support Disabled".

4.5.1. Merge7zInstaller

This is a stand-alone installer for 7-Zip integration.

Installer filenames may seem weird at first, but there is reason for them: they show supported versions. Filename is formatted Merge7zInstallerXXX-YYY-ZZZ.exe. XXX is build number, YYY earliest 7-Zip version supported and ZZZ latest 7-Zip version supported. For example Merge7zInstaller0014-311-426.exe means build version 14, and support for 7-Zip versions 3.11 - 4.26.

This separate installer is much more flexible since we can update it whenever 7-Zip is updated. And we don't add files users don't need to base installer.

The latest version is always available directly in our downloads at SourceForge.net: 7-Zip plugin and of course from our homepage at WinMerge.org.

[Tip] Tip

If you want to know immediately when we release new versions, you can Monitor our releases. When monitoring release, you get sent e-mail notifications about new releases when they happen.

Running installer is simple:

  1. Start installer executable

  2. Select installation type and DLL files (supported 7-zip versions) to install

    • Shared installation copies 7-Zip plugin files to system directory so they can be shared between multiple WinMerge installations and other programs using 7-zip plugin. This is recommended installation.

    • Application specific installation copies 7-zip plugin files to program directory. Files are then usable only by that program.

      This selection requires user to select executable in directory where plugin files are installed. Select WinMerge executable file when installing to WinMerge directory.

    • Enable standalone operation installs also required 7-Zip files to program's (application specific installation) directory. This allows minimal usable installation of 7-Zip for archive support. This can be used when 7-Zip application is not wanted or needed.

      This installation type does contain only needed files for WinMerge (or other application) to enable archive support. It does not install 7-Zip user interface or other related tools or files. After this install it is not possible to open or create 7-Zip archive files outside WinMerge.


5. Differences in files and how WinMerge handles them

Introduction chapter says WinMerge finds and shows differences between files. So user compares two files one knows are different and gets surprised - WinMerge tells there is 5 differences, but there are more different words in one line! What is going on with WinMerge?

Most natural way to show differences in text would be to show different characters and different words. And let user to check and copy these differences one by one. Like with spellchecker. That would be nice and easy if there are no many differences. But if we have long files with a lot of differences handling differences would become tedious work. Computers can handle that but not humans. So we need simpler and easier way to handle differences.

5.1. What is a difference?

Solution is to forget single letter or word differences and use lines. Lines are basic units for many compare and text file handling tools. WinMerge's compare engine uses also lines as basic unit.

Handling lines is a lot easier. If two texts to compare have few sigle different lines we are happy to handle them. But what if we have many consecutive different lines we don't want to copy those lines one by one.

So we combine those consecutive different lines to single block. Now we can handle this one block (consisting of several lines) with one command.

This block of different lines is called "difference" in WinMerge.

Now we need simple example to get this all combined:

Example 1. Two files with multiple differences

File1:

WinMerge detects differences in lines,
it does not look single characters.
That's because lines are a lot easier and
faster to compare and merge than characters.
Believe or not.

File2:

WinMerge detects differences in lines,
but it doesn't look for single characters.
Believe or not.

Those two texts contain several differences in lines and several different lines, but only one difference that WinMerge shows for user. For WinMerge, difference is lines 2-4 in first file and line 2 in second file. So WinMerge can show those lines as difference.

5.2. Missing lines

In example 1 there are 3 different lines in file1 and 1 different line in file2. In WinMerge differences must always have same amount of lines in both files. So WinMerge must add 2 empty lines to file2 so that both files have 3 different lines. We call these added empty lines as "missing lines" since they really don't exist in file2. Screenshot shows it:

If text is typed or copy-pasted to missing lines they become real lines.

5.3. Merging difference

So how those two files in example 1 can be made identical? Simply copying different lines from file to another. No need to care about single different characters, character offsets etc. Just lines.

But copying every single line is still a lot of work. Like already mentioned WinMerge creates differences from sets of different files. Instead of copying single lines we can copy these differences. It is a lot easier and faster to copy 5 differences than 100 lines.

5.3.1. Merging missing lines

But what about missing lines when merging? What happens to them? As mentioned earlier missing lines are not real lines. When copying lines WinMerge totally ignores missing lines. In example 1 we have missing lines:

  • Copy difference from file1 to file2 : WinMerge copies first line in difference in file2 with line in file1. Then WinMerge replaces two missing lines in file2 with real lines in file1.

  • Copy difference from file2 to file1 : WinMerge copies first line in difference in file1 with line in file2. Then WinMerge would copy two missing lines from file2 to file1. But missing lines are not real lines and do not exist in files. So WinMerge removes two lines from file1.


6. Opening Files and Folders

WinMerge allows selecting/opening paths in several ways. Using Open-dialog is just one of them.

6.1. Open-Dialog

Basic use of Open-dialog is described in Quick start. Here is some more detailed information and tips about how to use Open-dialog more efficiently.

6.1.1. Environment variables

Environment variables can be used as (part of) paths. An environment variable is expanded when its name is put between two %:s.

Example 2. Using environment variables

If an environment variable named WORKDIR contains the path c:\workfiles then %WORKDIR%\project1 is expanded to path c:\workfiles\project1 .

6.1.2. Opening archive files

Archive file support requires 7-Zip plugin to be installed. See Installing instructions.

Opening two archive files is similar to normal files: select two archive files to Open-dialog's "Left" and "Right" fields. If WinMerge recognizes the archive format, it opens the contents of the archive files to folder compare.

Folder Compare chapter describes how to work with archive files. If the archive file contains subfolders Original/ and Altered/ it must be opened by selecting same filename to both sides in Open-dialog or command line. Then WinMerge can compare contents of those two subfolders.

[Tip] Tip

When dragging an archive file to WinMerge window, press Shift when dropping the file and WinMerge will automatically copy the same filename to both sides and open the archive file.

6.1.3. Filter selection

Third edit field in Open dialog is for filter. This field can contain list of file extensions to include or file filter name.

Extensions must always be in format *.extension. So file extension list cannot be used for more advanced selecting, file filters are there for it. Different extensions can be separated by spaces, commas, colons or semicolons.

Example 3. Extension list

*.h;*.cpp *.txt,*.ini
[Tip] Tip

*. (star, dot and no extension) selects files without any extension, for example "README".

Field can also contain file filter name. Easiest way to select file filter is using Filters-dialog which can be opened with "Select..." button next to field. That dialog allows also creating, editing and deleting of filter files.

[Note] Note

If filter cannot be found by name or extension list is not valid WinMerge selects all files (i.e. uses *.* as extension list).

6.2. Shell Integration

The Shell Integration is a convenient way to select the paths using Windows Explorer. Installer enables Shell Integration if chosen so. Shell Integration can be enabled or disabled from Options/System. When the Shell Integration is enabled item WinMerge is added to the Explorer context menu (click right mouse button over file or folder in Explorer).

WinMerge accepts one or two paths. When one path is selected through Shell Integration WinMerge places it as "Left" path and open Open-dialog for user to select "Right" path. Also if two paths are selected but another path couldn't be opened for reason or another WinMerge shows Open-dialog for selecting valid paths.

Simple WinMerge context menu

6.2.1. Advanced Shell Integration

Selecting "Enable advanced menu" for Shell Integration from options adds more choices for path selection. Now WinMerge adds two menu items to Explorer context menu: "Compare To" and "Compare...". Compare To selects path as first ("Left") path. When one path is already selected (memorized) WinMerge adds items "Compare" and 'Re-select First" to context menu. Now Compare selects path as "Right" path and compares it with previously selected path. Re-select First allows re-selecting first path. Handy when wrong item got accidentally selected as first path.

Sounds complicated, but luckily it is not - in practice:

  1. Select first item you want to compare, open context menu and select first "Compare To" item. Path is now in memory.
  2. Browse to location of second item you want to compare and select it. Open context menu and move menu selection over first "Compare" item. Now Explorer's status bar shows memorized path to which you are comparing newly selected path.

Advanced WinMerge context menu

After memorized path is used for compare it is forgotten. So user cannot select one item to memorize and then compare it against several paths.

[Tip] Tip

Take benefit of Open dialog's MRU lists! Compare... Item selects path as"Left" path and opens Open-dialog. Now you can select "Right" path from MRU list. This is very handy when you need to compare one file/folder against several files/folders.

6.2.2. Including Subfolders

Shell Integration by default does not include subfolders into comparison. This default behavior can be changed using Include Subfolders by Default option in System options. Default behavior can be also changed by holding down Control -key while selecting Compare-item from the Explorer context menu.

6.3. Drag and Drop

One or two paths can be drag and dropped to WinMerge window from Windows Explorer, Desktop or whatever source Windows allows dragging paths from. WinMerge does not include subfolders in compare. Subfolders can be included by pressing Control-key while dropping paths.

Another useful key when dropping paths is Shift. When there is only one path dropped and Shift is pressed that same path is opened to both sides.

6.4. Project Files

Project files allow fast and easy opening of commonly used paths (and filter). The user can easily save currently open paths as project file for later use.

6.4.1. Opening Project File

Project file can be given to command line like normal file or opened from File->Open Project... WinMerge reads paths from project file and if two paths are given opens them. If only one path is given or one of paths is invalid, the Open-dialog is shown for user to select the second path or valid paths.

Project file can be selected also in Open dialog. There are couple of things to remember:

  • If two project files are selected, project files themselves are compared.
  • If project file is selected as left-side file, and right-side file is empty, project file is opened like using File->Open Project... dialog.
  • If project file is selected as left-side file and any other file as right-side file, contents of project file and another file are compared.

6.4.2. Editing and Saving Project File

Project files can be edited and saved using Project File -dialog that can be opened from File->Save Project... When opened, the dialog is initialized with values from the current compare. Values can be edited and saved to the project file with Save... button. One can also load existing project file with Open... button.

Project File -dialog

6.4.3. Format

Project files are simple XML files with .WinMerge extension.

<?xml version='1.0' encoding='UTF-8'?>
<project>
    <paths>
        <left>c:\work\project1</left>
        <left-readonly>1</left-readonly>
        <right>c:\work\project2</right>
        <right-readonly>0</right-readonly>
        <filter>Visual C++ loose</filter>
        <subfolders>0</subfolders>
    </paths>
</project>

The project file has six fields:

  • <left>...</left> : Left side path to open
  • <left-readonly>...</left-readonly> : 1 if left side path is opened as readonly, 0 to open normally
  • <right>...</right> : Right side path to open
  • <right-readonly>...</right-readonly> : 1 if right side path is opened as readonly, 0 to open normally.
  • <filter>...</filter> : file filter name or list of extensions
  • <subfolders>...</subfolders> : 0 if subfolders are not included and 1 if they are included

None of the fields are required and they can be empty (<left></left>).


7. Comparing Folders

The Folder compare window displays all of the files and subfolders compared in a sortable list view. Files and subfolders may be synchronized by copying or deleting, and actions may be performed on multiple items simultaneously. The columns displayed may be changed and reordered.

Folder comparison has two different modes. The mode is selected in the Open dialog with the "Include Subfolders"-checkbox.

  • When subfolders are included, all subfolders and their contents are compared. Files are displayed depending on the options on the View menu (eg, Show Identical Files). Common folders are never displayed (but all files inside of them are). Folders only existing on one side are displayed according to the View menu options (eg, Show Left Unique Files).

    This mode does not allow browsing folders and can be slow if there are many subfolders and files. But it is easy to see and handle different files in whole folder structure.

  • When subfolders are not included only files in selected folders and names of subfolders are shown.

    This mode allows browsing folders by opening subfolders and parent folders. This mode has the advantage of speed, as it may be much faster when there are many subfolders that need not be examined. Also the display may be easier to manage, showing only items in one folder.

In WinMerge version 2.4 and later there is a Compare by Quick Contents -compare method which makes possible to compare big binary files. For more information about different compare methods see Options & configuration -chapter. In WinMerge version 2.4 and later all files bigger than 4 MB (megabytes) are automatically compared with Compare by Quick Contents -method. Downsides for this method are that linefilters do not work and there is no difference counts information in folder compare UI. For most cases this should not matter since so big files usually are binary files.

For advanced users: If that limit does not feel good (you have lots of big text files) it can be changed via registry value:

HKEY_CURRENT_USER\Software\Thingamahoochie\WinMerge\Settings\QuickMethodLimit

. As usual be careful when changing values directly to registry!

7.1. Compare Results

Files and folders are compared and divided into several categories. Categories are easy to recognize from these icons:

Identical text files
Differing text files
Identical binary files
Differing binary files
Left-only folders
Right-only folders
Left-only files
Right-only files
Skipped directories (filtered out)
Skipped files (filtered out)
Items that couldn't be compared. This usually happens when other program has locked the file.
Aborted item. WinMerge did not finish comparing this item when compare was stopped. Result is unknown.

7.2. Folder Compare Status

During the folder comparison WinMerge shows status panel:

The panel shows approximate status and progress of the compare. Status is shown as a number of items and a progressbar. Numbers show how many items (files and folders) WinMerge has found to compare. Progressbar shows same info graphically.

[Important] Important

Progressbar is for item counts. As there usually are different sized files in compare it does not directly map to time used/remaining. So 50/100 items does not strictly mean compare is in half by time used.

Folder compare can be stopped by selecting Stop-button and results for files and folders compared so far are shown. When compare is stopped before it finishes, some files may be in middle of comparison. Those files are marked as Aborted in comparison results. It means result is not available for them.

When folder compare is ready status panel is closed and results are shown.

[Note] Note

This is one of most visible changes in WinMerge version 2.6. New status panel may feel "just too simple" after using previous WinMerge versions. The fact is most of the details in previous versions were useless during the compare. So simplicity was choosen for new design. Automatic closing may also feel weird at starters. But there is no information visible that would be needed after the compare.

Compare statistics are visible in separate dialog which can be opened after compare from menu: View->Compare Statistics.

7.3. Selecting Items to Show

In "View" menu there are several choices for selecting which categories to show / hide.

  • Show identical files : shows and hides files detected as identical
  • Show different files : shows and hides files detected as different
  • Show left unique files : shows and hides files and directories present only in left side
  • Show right unique files : shows and hides files and directories present only in right side
  • Show binary files : shows and hides files detected as binaries
  • Show skipped files : shows and hides files and directories filtered out by file filters

7.4. Columns in Folder Compare

By default these columns are visible:

  • Filename
  • Folder : Relative folder name for compare path. If subfolders are not included this is empty.
  • Comparison result : Verbose comparison result (see also Short Result)
  • Left Date & Right Date: Modification date of item. Note that newer date is prefixed with asterisk "*".
  • Extension : File's extension, handy for sorting

Following columns are available through "Customize Columns"-dialog:

  • Short Result : Result in shorter form ("Right Only").
  • Binary : Column contains an asterisk "*" when the file is a binary file. This is handy for sorting and to use with "Short Result"-column.
  • Left Attributes & Right Attributes : Shows file attributes.
  • Left Creation Time & Right Creation Time : Item creation time.
  • Left Encoding & Right Encoding : File encoding. Shows codepage number for ANSI files, and Unicode encoding for Unicode files.
  • Left File Version & Right File Version : Version number from file if present. Note that this is read for only some binary file types known to usually have a version resource.
  • Left Size & Right Size : File size in bytes.
  • Left Size (Short) & Right Size (Short) : Shorter versions of file sizes, rounded to kilo-, mega- or gigabytes.
  • Newer File : Shows which side is newer.
  • Differences : Amount of differences found between files, not including possibly ignored differences.
  • Ignored Diff. : Amount of ignored differences in files. These are differences ignored by line filters.
  • Left EOL & Right EOL : Show EOL style (linefeed style) of files.

7.5. Browsing Folders

Browsing folders is only possible when subfolders are not included to compare (Include Subfolders checkbox is not checked in Open-dialog). Parent folders (".."-item) and subfolders existing in both sides can be compared by double-clicking with mouse over them or selecting them and pressing Enter.

Sometimes parent folder cannot be opened (no access to it). These two icons indicate if parent folder can be opened:

Parent folder can be opened.
Parent folder cannot be opened.

It is possible to browse both sides to the same folder (C:\Work\ and C:\Work\). 2.6 and earlier versions of WinMerge prevented this, but it restricted usage in some cases. In such case both sides contain the exactly same files and folders.

It is possible to select two different folders from the folder compare and open them to different sides. First selected folder becomes the left-side folder and second selected folder becomes the right-side folder. This can be used in situation explained in previous paragraph when there is same folder compared as both sides.

7.5.1. Unique Folders

WinMerge 2.6 and earlier could not open unique folders (folders existing only in other side). An error message was shown about trying to open unique folder. This restriction came from a fact that WinMerge cannot compare existing folder to non-existing folder. If one wanted to copy contents of unique folder, then whole folder structure must been copied.

Copying whole unique folder structure is many times not wanted. WinMerge 2.8 allows creating the missing folder and browsing then into that created folder. So that contents of original unique folder and created empty folder can be compared. Now it is possible to copy just one file (or subfolder) in unique folder.

To navigate into unique folder, select the folder, and browse into it as normally (press Enter -key, double-click over foldername with mouse, or select MergeCompare from the menu. WinMerge shows a message asking if the missing folder should be created. Answer Yes to create the folder, or No to cancel the action.

7.6. Navigation in Folder Compare

In addition moving selection using mouse or keyboard, also Merge-menu navigation commands, toolbar buttons and shortcut keys can be used. For example "Next diff" finds next different file and selects it.

[Note] Note

Unique files and folders are considered as different ones.

Multiple files/folders can be selected. However not all operations are possible with multi-selection.

7.7. File Operations in Folder Compare

7.7.1. Copying, moving and deleting

Folder compare allows user to copy and delete files and folders. File operations are available through context menu (right-click with mouse). Also files can be opened to associated program or into external editor.

In file operation menu, there are one or two numbers shown, depending on files/folders selected. If there is one number shown, for example "Copy/Left to... (5)" that means there is 5 items selected, and all items can be copied. But if there is two numbers shown, for example "Copy/Left to... (3 of 5)", that means there are 5 items selected but only 3 items can be copied.

Most common operation is copying files from side to side. File can be copied from side to side using Merge-menu items, toolbar buttons and context menu. If multiple files are selected, or file to overwrite is read-only, confirmation dialog is shown.

Sometimes it is useful to copy certain files and/or folders to another folder instead of another compared folder. This can be done selecting "Copy/Left to..." or "Copy/Right to..." items.

Another file/folder operation is deleting. Items in another or both sides can be deleted. There is "Send deleted files into Recycle Bin" option in system options (See Options & Configuration -chapter). It is highly recommended to keep that option enabled so deletion can be undone if accidents happen. Note however recycle bin does not help if its disabled from Windows settings.

Moving is just a shortcut for copy + delete.

[Warning] Warning

File/folder deletion cannot be undone if Recycle Bin is not used!

7.7.2. Renaming

Renaming files and folders is available through context menu item Rename or using F2 -shortcut key. Edit-box appears and allows editing of the name. Renaming can be cancelled by pressing Esc -key. Note that items in both sides are renamed. Renaming just other side is not currently possible.

7.7.3. Opening files

There are three items in Open-menus:

  • With Registered Application : Opens file with application registered for editing filetype for Windows, if there is one.
  • With External Editor : Open with external editor. Default editor can be selected from options, Notepad is used by default.
  • With ... : Opens "Open With..." dialog asking from user with which application files should be opened.
[Tip] Tip

Selecting With Registered Application when folder is selected usually opens that folder into new Explorer window.

7.7.4. Archiving

Zip-menu in directory compare context menu allows adding selected items to archive file.

[Note] Note

Archive support requires that 7-Zip plugin is installed to system.

Zip-submenumenu has four items:

  • Left... : Adds left-side files and folders (recursively) to the archive file
  • Right... : Adds right-side files and folders (recursively) to the archive file
  • Both... : Adds files and folders (recursively) from both sides to the archive file. Because filenames are same, files must be put to subfolders inside archive. Left-side files are put to subfolder Original/ and right-side files are put to subfolder Altered/.
  • Differences... : This is like above Both, but this item adds only different files (including unique files) from both sides.

After selecting one of Zip-menu items dialog pops up asking filename and archive type from user. WinMerge cannot add files to existing archive files but it always creates new archive file.

[Tip] Tip

WinMerge looks for subfolders Original/ and Altered/ in archive files. If archive file contains these subfolders and same filename is given to both sides WinMerge compares contents of those two folders.

If directory compare shows contents of archive files WinMerge updates changes done to files in file compare into original archive file. But WinMerge does not update archive contents for files added/deleted/copied. User can create a new archive file using above menuitems instead.

7.8. Copying Path- or Filenames

In context menu there are items for copying selected items' paths or filenames to clipboard. This feature makes it easy so get list of changed files, for changelogs etc.

  • Copy Pathnames has three subchoices like other file handling functions. It copies full pathnames of selected items to clipboard, one per line.
  • Copy Filenames copies only filenames without paths.

7.9. Customising Folder Compare

There are many ways to customize folder compare:

  • Sorting by column : Sorted by column can be selected by clicking column name with mouse. Little arrow appears next to column name indicating that results are sorted by this column and sort order.
  • Selecting visible columns : "Display Columns" dialog can be opened from Tools-menu or by right-clicking column header with mouse.
  • Changing order of columns : Order can be changed in "Display Columns" dialog or by drag & dropping column names with mouse.

7.10. Protecting Folders / Read-only Folders

If user wants to protect one or both sides from changes, user can set them to read-only from File-menu.

[Important] Important

Setting read-only protects files and folders in current compare view only.

Protected status is inherited to opened files from directory compare. If user compares two folders, sets another to protected and opens two files for comparing, file opened from protected side has protection set too.

Protection status is shown in statusbar, there are own panes for left and right side.

7.11. Hiding Items

Selected items can be hidden from view using context menu item Hide Items. Hidden items are not shown until next refresh is done. All hidden items can be re-shown selecting View->Show Hidden Items.

Hiding items is handy to remove already handled items from the view. So when you have merged files, use context menu item to hide them. It is a lot easier to see what items are left to merge. Get used to it! It saves your time!

7.12. Refreshing Only Selected Items

Full refresh of large folders can take a long time. In 2.2 and earlier versions of WinMerge user always had to do full refresh after editing files outside WinMerge. WinMerge 2.4 and later can refresh just selected items. Select Refresh from the context menu or View->Refresh Selected from the main menu.


8. Comparing Files

File compare window is basically two files opened to editor into two horizontal panes. The editor allows user to do a basic file editing inside WinMerge without needing to open files to external editor program or development environment.

File Compare Window

WinMerge editor is not comparable to specialized editor programs, but it has basic features like Undo/Redo, Find/Replace and Goto (to linenumber). The editor also has a syntax highlighting feature supporting several file formats (colors configurable). Note however WinMerge does not syntax highlight text inside differences. Syntax highlighting can be disabled from options.

[Tip] Tip

If Automatic rescan is not enabled manual refresh is recommended after editing.

8.1. Showing the Differences

WinMerge uses different (user configurable) colors to highlight and select differences. By default WinMerge shows different lines with yellow background and missing lines with gray background. If user selects the difference, it is shown with red background and missing lines with milder red.

8.2. Tabs

WinMerge can show open windows in tab bar below toolbar. Tab bar can be shown and hidden from menu View->Tab Bar. When the tab bar is shown it has one tab for every open window. The tab contains last part of the folder names or file names.

8.3. File Headerbar

The file headerbar has several functionalities. See screenshot below:

Headerbar shows full path to the open file. If the path is longer than available space one part of the path is replaced with an ellipsis (...). Headerbar also shows:

  • the current active file with sunken border (like in the above screenshot), the non-active file is shown with flat headerbar.
  • if the file has been modified (has unsaved changes). This is indicated by adding asterisk (*) before the filename, like in the screenshot.

Headerbar has a context menu with items to copy full path or filename to clipboard.

8.4. Statusbar

Statusbar upper line shows information about current line. In first pane:

  • Ln : current linenumber
  • Col: current column for cursor and total number of columns in line
  • Ch : current char for cursor and total number of chars in line
  • EOL : current line EOL style (shown only when Preserve original EOL chars-option is enabled)
[Note] Note

Col counts TAB as X chars (as defined in editor options) and Ch counts TAB as one character.

Other three panes are:

  • read-only: RO is shown in the pane if the file is read-only / protected
  • encoding: this pane shows codepage number for ANSI files and Unicode encoding type for Unicode files
  • EOL style: EOL style can be Win for Windows/DOS files (CRLF), Unix (LF) or Mac (CR)

Note there are two different ways to show EOL style. When per-line EOL style is not remembered, EOL style is shown on own pane in statusbar. And when per-line EOL style is remembered line's EOL style is shown after char number. When per-line EOL style is used there is no file-wide EOL style.

Difference between column and char is that column counts tabulator character as so many (space) chars as it occupies (4 by default, can be changed from options). But char count counts tabulator char as one char.

Lower line in statusbar shows current difference and amount of differences. Text can be:

  • Identical : files are identical there are no differences
  • X differences Found : amount of differences, no difference is selected
  • Difference X of Y : amount of differences (Y) and number of selected difference (X)

8.5. Editor Margin

The editor panes (file panes) have optional gray margin area for line numbers and some symbols. This margin can be shown/hidded from menu View->View Margins. The margin shows:

  • Line numbers (from menu View->View Line Numbers)
  • Bookmarks (menu Edit->Bookmarks)
  • Word wrap symbols, when word wrap is enabled

When line numbers are not shown then margin is shown like screenshot below.

Blue circle is a Bookmark. And arrow marks word-wrapped line. Next screenshot shows same lines without word-wrap and with linenumbers.

If linenubmers are not visible it takes pretty minimal width. Note that with linenumbers the margin width is set so that the longest line number fits into it. So with large files with lots of lines it needs space for several numbers.

8.6. Difference Navigation

Difference navigation commands are in Merge menu:

8.6.1. Selecting a difference

Before difference can be merged, it must be selected. Selecting can happen by difference navigation keys/items (see below) or by selecting wanted difference directly:

  • Double-click over difference with mouse
  • Move cursor inside difference and select it with Current Difference.

8.6.2. Navigating differences

Merge-menu has items for navigating to next/previous and first/last difference. Navigation is always done based on current cursor location. So Next Difference-command selects next difference from cursor, not from current selected difference.

[Note] Note

When difference is selected with navigation commands cursor is moved to begin of first line of difference. In both files.

8.6.3. Current Difference-command

This command has two important functions:

  • When there is no difference selected and cursor is inside difference, it selects this difference. This is very handy way to select difference from keyboard.
  • When there is selected difference, it scrolls to selected difference. This is handy if user has scrolled selected difference out of screen. So this allows user to scroll files to see other contents and quickly return back to selected difference.

8.6.4. Go To line or difference

Using Go To from Edit-menu user can jump to certain line or difference. Go To -dialog shows current line and side when opened.

[Tip] Tip

Go To line number is useful if there is need to merge same change to several target files from one original file. Rather than using Find or difference navigation it is faster to jump to first line of difference.

8.7. Merging Differences

Merging commands are located in Merge-menu after navigation commands. Basically there are only two types of merging commands - copy difference from right to left and copy difference from left to right. Additional commands make merging several differences easier.

Copy to Right and Copy to Left copy difference from side to side. At simplest this means replacing text in destination difference with text in source difference. But because difference can contain also removed lines, new lines may be created or some lines removed. If there are several differences selected, then all fully selected differences are merged with one command. This makes merging many small differences a lot faster.

WinMerge rescans files after every merging operation. This is done to ensure differences were copied correctly and all changes after last rescanning are taken care of. If Automatic rescan-option is not set, user may have edited files and differences may not have shown correctly before merging. If result of merging is not what were wanted, user can undo merging operation.

[Important] Important

It is strongly advised to run Rescan (F5) before merging differences if Automatic rescan is set off. Usually files get out of sync when editing and merging differences may have unpredictable results. If merging result looks incorrect try undoing (Edit->Undo from menu or Ctrl-Z) it and rescanning files. And then merging again.

Copy to Right/Left and Advance-commands merge current difference and then select next difference (if there is one). Using these commands makes merging several differences easier and faster.

Copy All to Right/Left-commands sync two open files by merging all differences. Note that you can undo this whole operation with one undo command.

[Tip] Tip

Enable Automatically scroll to first difference -option from general options. This saves you from scrolling to first difference and selecting it. See Options & Configuration -chapter for more information.

8.8. Merge Mode

Merge mode can be enabled from the File-menu. It restores the WinMerge 1.7.1 single keys for difference merging and navigating:

  • Up- and Down arrow keys select previous and next difference
  • Left- and Right arrow keys merge difference to left side or right side.

Unlike the normal mode, in this schema the Alt-key is not needed for these basic operations (which makes them quicker and more convenient). Note that Shift-Arrow, Alt-Arrow and Ctrl-Alt-Arrow keys work in merge mode like in normal mode.

When merge mode is enabled Merge text is shown in statusbar.

8.9. Refreshing

Refreshing updates differences after changes are made to files. It is important to do a refresh before merging changes between files.

[Note] Note

Refresh does not reload file. That means, if another programs has updated files etc, those changes are not seen. Refresh updates differences according changes user has done.

8.10. View Whitespaces

When enabled from View menu View Whitespace feature shows all whitespace characters (spaces, tabulators, line ends). This is very useful for example when there are spaces in other file and tabulators in other. Also, if Preserve original EOL chars is enabled, WinMerge shows type of EOL (Windows/Unix/Mac).

8.11. Editing Files

Normal editing features work in WinMerge editor. User can type and delete text, select text, copy, cut and paste text etc. There is some customisation because there can be removed lines in files (lines existing only in other side). Anyway these customisations are not usually visible to users otherwise that lines can sometimes "jump" when WinMerge has to relocate matching/non-matching files.

8.12. Line Difference Highlight

WinMerge can automatically highlight all differences it finds in lines. This makes it fast to look through and find differences. See screenshot below for an example of highlighted differences.

This feature can be enabled and disabled from menu View->View Line Differences.

With default settings WinMerge uses whitespace characters (namely spaces and tabulators) to separate words. WinMerge does not consider commas or dots as word separators. That means WinMerge thinks "For Example" is two words but "For,Example" is one word. More characters can be included as word-separator characters from editor options (select from menu Edit->Options and Editor page). See Options & Configuration -chapter for more information.

8.13. Line Difference Selection

Many times it is useful to see exact differences inside lines. WinMerge can highlight different area between lines. This feature is called Select Line Difference. It is available in Edit-menu, toolbar and shortcut key (F4). In screenshot below there is one difference highlighted

8.14. Location Pane

Location pane is a handy side-pane showing a overall (difference) map of files compared.

Location Pane shows differences as they are located in the files. So it gives a good overall view for files compared. Location Pane shows differences with same colors than editor panes. There are different indicators in Location Pane:

  • small triangles point to begin of the selected difference
  • selected difference is shown with different color
  • area visible in editor panes is shown with different background color

Clicking with mouse in Location Pane moves cursor to place clicked in file. Right-clicking with mouse opens the context menu with items to select line to go to. And the visible area locator (area with different background color) can be used like a scrollbar thumb - after pressing down the left mouse button over it can be dragged upwards and downwards to scroll the files.

8.15. Context Menu

File compare context menu contains items for frequently used features:

Most of these items are familiar from Main menu. Worth noting is last item Open. It allows to open file with (system) registered application or with external editor. Also context menu merge-commands are not relative to active file. They always merge the selected difference.

8.16. Fonts

Font used by editor can be changed from View->Select Font.... Due to limitations in the editor, only fixed width fonts are supported in WinMerge.

Font suggestions for use of WinMerge with East Asian languages:

  • Simplified Chinese texts with the SimSun or SimHei fixed-width fonts
  • Traditional Chinese texts with the MingLiU fixed-width font, or
  • Japanese texts with the MS Gothic or MS Mincho fixed-width fonts
  • Korean texts with the GulimChe fixed-width font (not Gulim as this variant uses proportional-spacing glyphs that are not centered in grid cells and then poorly aligned in fixed-width mode)

8.17. Resolving Conflict Files

WinMerge can resolve conflict files several version control systems produce when merging files. Conflict file is basically two different versions of files embedded into one file. WinMerge reads this file and separates it into its original files, and shows those files in file compare. So conflicted file can be resolved using normal WinMerge file compare functionality.

8.17.1. Opening Conflict Files

Conflict files can be opened into WinMerge using File->Open Conflict File.... Conflict file to resolve can be selected using file selection dialog that opens. At the moment there are no other ways to open conflict files.

[Warning] Warning

WinMerge overwrites original conflict file. If original file is wanted to save, it must be copied to another folder or another filename before opening it into WinMerge.

8.17.2. Conflict Resolving

WinMerge opens conflict file into normal file compare (see above). All normal WinMerge file compare features are in use. Files in two panels are:

Left panel: this file is called "theirs" file. It is usually the file that is in version control system's repository. This file usually cannot be edited. An as such, WinMerge opens left-side file as read-only. Differences can be moved only from this file to the another file.
Right panel: this file is called "mine" file. It is the user's working file originally. All changes should be done to this file. I.e. this file is at the same time the result file.

After the wanted resolved file is in right-side panel, it can be saved like normal file. WinMerge saves the file over original file.

Left side "mine" file is set to modified after opening conflict file. This allows fast resolve by just saving the file when user's file is the wanted end result. This also prevents accidentally not resolving the files. As resolving only happens when file is saved. If file is no saved, original conflict file is kept unmodified.

Many version control tools allow configuring external merge tool. WinMerge accepts three filenames ("Theirs", "Mine" and "Resolved") as command line parameters. See more info from Command Line -chapter. Single path to the conflict file is also accepted in command line.


9. Options & configuration

Options dialog can be opened from Edit-menu or from toolbar button. Changes made are saved when dialog is closed using OK-button (or pressing Enter-key).

9.1. General options

9.1.1. Automatically scroll to first difference

When this option is enabled:

  • After folder compare selection is moved to first different files or folders.
  • After opening files for compare first difference in files is scrolled visible and selected.

9.1.2. Disable splash screen

User can disable splash screen appearing when WinMerge is started. It does not make WinMerge start faster (splash screen can be missed by clicking it with mouse) but it saves one click.

9.1.3. Close Windows with ESC

If this option is enabled, WinMerge closes document windows and application with ESC key. One window is closed with one keypress, so if user has file compare window open one needs three keypresses to close WinMerge: file compare window, folder compare window and then the application.

Note that -e command line parameter overrides this option. If -e parameter is given in command line, WinMerge closes with one ESC key press.

9.1.4. Automatically verify paths in Open-dialog

When enabled: Open-dialog checks both paths given for validity and doesn't enable OK button until both paths are valid. Unfortunately this checking needs little delay and some users find this delay annoying.

When disabled: Open-dialog enabled OK button by default and lets user to try to open all paths. However error message is shown if path is not valid. This is faster to use, there is no any delay in enabling OK. But user must look at error-dialogs.

9.1.5. Allow only one instance to run

Limits WinMerge program instances to one. If new instance is tried to start, old instance is activated instead. If new instance is tried to open with paths, new paths replace existing ones in previous instance. Or, if multiple compare window support is enabled new compare windows are opened for new paths. (See below.)

9.1.6. Open-dialog Auto-Completion

This option allows user to enable auto-completion for Open-dialog paths. There are two modes for auto-completion:

  • From file system - checks paths from filesystem. I.e. It locates paths matching letters already typed and if matching path is found, completes the path.

  • From MRU list - checks paths only from MRU list. This is handy when you have pretty limited set of paths (usually in MRU lists) to compare.

9.1.7. Enable multiple compare windows for

Allows opening multiple folder or file compare windows into one WinMerge instance. WinMerge has separate compare documents for folder- and file compare and this option allows selecting multi-window support for both of them independently.

[Note] Note

File compare windows are always related to folder compare windows. Even if you disable multiple file compare windows you still can open one file compare window for every folder compare window.

9.1.8. Reset messageboxes (Reset-button)

WinMerge allows user to hide (suppress) some common messageboxes. For example if user doesn't want to see The files are identical messagebox every time two identical files are opened user can check checkbox in that messagebox and close messagebox. Then that messagebox will not be shown again.

However sometimes user may want to see again those hidden messageboxes. Selecting Reset button makes all messageboxes visible again.

[Note] Note

It is recommended to reset messageboxes when updating to newer version of WinMerge. Installer does that automatically but if installer is not used then it should be done using this Reset button.

9.2. Compare options

Several compare options allow to ignore some specific type of differences. This is useful in reducing insignificant differences for review purposes.

Ignored difference is shown with different color and it cannot be merged. Difference counts do not include ignored differences. So if files contains only ignored differences they are shown as identical in directory compare.

[Important] Important

Ignoring differences affects merging! If user ignores whitespace changes, then e.g. indentation changes in source code files are ignored. That means file's indentation gets messed up when merging. It is strongly recommended to turn off all difference ignore options before merging files!

9.2.1. Whitespace

Compare Whitespace, Ignore whitespace change and Ignore all whitespace are three different levels for comparing/ignoring whitespace characters.

Ignore whitespace change ignores changes in whitespace chars. First three lines in example below illustrate this, those three lines are detected as identical if this option is set. However change between zero and more whitespace characters is NOT ignored. So fourth line is different from first two lines

Example 4. Ignore whitespace change

One space between words:

Two Words

Two spaces between words:

Two  Words

Tab between words:

Two	Words

No spaces between words:

TwoWords

Ignore all whitespace ignores all whitespace characters, except linefeeds. WinMerge compares lines, and even when this option is set linefeeds are intact. All lines in example below are detected as identical.

Example 5. Ignore all whitespace

One space between words:

Two Words

Tab between words:

Two	Words

No spaces between words:

TwoWords

9.2.2. Ignore blank lines

Ignores differences that have only blank (empty) lines. Blank lines are shown in file view, but difference is shown with ignored difference colors and it cannot be merged.

9.2.3. Ignore case

If this option is enabled WinMerge ignores differences between lowercase and uppercase letters. For example "LowerCase" and "LOWERCASE" and "lowercase" are same.

9.2.4. Ignore carriage return differences (Windows/Unix/Mac)

If this option is not set WinMerge does not detect EOL style differences as differences. If two lines differ only by EOL characters (e.g. Windows EOL and Unix EOL) WinMerge detects files as identical.

9.2.5. Enable moved block detection

When this option is enabled WinMerge tries to detect lines that are moved inside file. Moved lines have own difference colors. Also location pane can show moved lines with line between bars. This makes it easier to visualise changes in files. However if there are a lot of moved lines it may get messy looking.

9.2.6. Ignore time differences less than 3 seconds

Only for "Modified Date" and "Modified Date and Size" compare methods.

It is possible that timestamps vary by one or two seconds in certain situations. This usually happens with network shares. Normally WinMerge determines such items as different. So this option allows WinMerge to ignore time differences smaller than three seconds to help getting more reliable results.

[Warning] Warning

This option should be enabled only when the time difference is detected. Otherwise it can cause wrong compare results.

9.2.7. File compare method

File compare method has five choices:

  • Full Contents - full comparison of files by content, with all the bells and whistles. This method invokes plugins and uses diffutils engine for fully accurate differencing and moved block detection. This is the most complete and recommended method.

  • Quick Contents - slimmed down comparison of files by content. This method uses streamlined file comparison code which skips plugins and moved block detection. The only advantage of this method over Full Contents is that this method does not load the files into method, and so is faster.

    Drawback is linefilters are not applied when comparing. Even if linefilters ignore all differences in files and files are considered identical by Full Contents -compare method this method sees files as different.

  • Modified Date - comparison of modification dates on files. This method only examines the modification dates on the files, so it is far faster than either of the contents methods, but obviously is only as accurate as the modification dates.

  • Modified Date and Size - like above Modified Date -comparison. But also checks file sizes when dates are identical.

  • Size - comparison of the sizes of the files. This method only examines the file sizes, so it is fast, but not so accurate like the contents methods.

9.2.8. Stop after first difference

[Note] Note

This option is enabled only when Quick Contents -compare method is selected.

This option allows to optimize compare by not looking whole files, but only until first difference is found.

Drawback is WinMerge may be unable to recognize binary files as such. This is even likely if first difference is in begin of file. Don't enable this if you don't know which kind of files you are comparing. If you know your files then this is a nice way to make compare even faster.

9.3. Editor options

9.3.1. Syntax highlighting

From Editor-page user can enable/disable syntax highlighting. WinMerge can syntax highlight many programming language source codes, web formats etc. Syntax highlighting consumes some processing power, so if WinMerge screen updating seems to be slow, turning off this option might help.

9.3.2. Automatic rescan

Enabling automatic rescanning forces WinMerge to rescan after every change done to files, including typing. That's how WinMerge 1.7.1 behaves. For bigger files this can make editing files very slow. To make file editing faster edit events are 'delayed'.

Delaying means WinMerge waits one second after last edit event before rescanning. If new edit event happens during that time editing is done and counter reset to one second. So there should be no rescans during normal typing, but only after user stops typing.

When automatic rescan is disabled, rescan is done only when user selects Rescan or user merges difference.

WinMerge 2.2 release delays more edit events than 2.0.x releases, so selecting between automatic and manual rescan is mostly a matter of taste.

9.3.3. Preserve original EOL chars

[Important] Important

This is an advanced option for users who are familiar with EOL bytes and who want to compare files with different EOL styles inside ONE file. It is recommended that this option not be set unless this advanced functionality is needed.

Setting this option allows handling and comparing files with different EOL styles inside ONE file. Two files with different EOL styles can be compared even without this option set! One example reveals functionality behind this option.

This is one example
text. To show how
smart WinMerge
can be handling
EOL differences.

And same text in bytes:

5468 6973 2069 7320 6F6E 6520 6578 616D 706C 6520 0D0A
7465 7874 2E20 546F 2073 686F 7720 686F 7720 0D0A
736D 6172 7420 5769 6E4D 6572 6765 0D
6361 6E20 6265 2068 616E 646C 696E 6720 0D0A
454F 4C20 6469 6666 6572 656E 6365 732E

The example presents one simple text file with five lines of text. All lines, except third, are terminated with Windows style EOL (0D0A). Third line has Unix style EOL (0D).

If Preserve original EOL chars-option is not set WinMerge determines file is meant to be Windows style file and converts third line's last bytes to 0D0A before comparing. Missing EOL char is usually an error in file, so WinMerge is smart and fixes this error instead of reporting it as a difference. That's right, WinMerge changes user's file without telling about it to user. WinMerge also shows files EOL style as Windows in filecompare statusbar.

Advanced user might want to handle files without this automatic fixing, file might be handled in systems with different EOL styles (e.g. Windows and Unix). In that case, user can set this option and see WinMerge showing EOL style for every line.

9.3.4. Tab options

From General-page user can set size tabulator character in spaces. Maximum value is 64.

Another selection is if user wants WinMerge to add tab characters or spaces (amount specified by tab size -option) when Tab-key is pressed.

9.3.5. Line Difference Coloring

WinMerge can highlight exact differences in different lines. This behaviour is controlled by these options First checkbox View Line Differences controls if highlighting is enabled or disabled.

Next two choices are about level of highlighting. Best choice usually depends on filetypes compared.

  • Character level - this level tries to find exact characters that are different. This is especially useful when working with fileformats that do not have clear word-breaks. This level is capable to highlight single changed character in middle of word. It may save a lot of time when trying to find those single-character differences.

  • Word-level - this is what WinMerge version 2.4 and earlier had. It tries to find different words to highlight. There is extra value in selecting whole words - usually it is easy to select words in editor so copy/paste is easier when words are selected. This is also case with WinMerge editor. You can for example select word in editor by double-clicking it with the mouse.

Word-level highlighting has one additional option. Dropdown control below it controls how word-breaks are detected. Normally (Break at whitespace selected) words are assumed to be separated by whitespace characters. This is what we have in normal text.

When Break at whitespace or punctuation is selected, also punctuation characters are considered as word-breaks. When this is selected WinMerge can better handle comma separated lists etc. For example, for lines:

10,20,30,40,50

and

10,25,30,45,50

WinMerge would highlight whole lines when using Break at whitespace but only numbers 20/25 and 40/25 when using Break at whitespace or punctuation.

9.4. System options

9.4.1. Send deleted files to Recycle Bin

When this options is enabled files and folders deleted in directory compare are moved to Recycle Bin. Note that use of Recycle Bin may have disabled from system.

9.4.2. Add to explorer context menu

This option enables/disables shell integration. When enabled, new menuitem WinMerge is added to explorer's context menu. User can select one or two files/folders and then select that menuitem to open files/folders to WinMerge.

9.4.3. Enable advanced menu

If this option is enabled there are two items shown in explorer's context menu. First item (Compare) allows user to select path to "memory" and then pick another path and compare those two. This means user does not need to select both paths from same view, but user can select them from different drives etc. Path is forgotten from memory when its compared.

Second item (Compare...) in menu always opens WinMerge with selected path(s).

9.4.4. Include subfolders by default

Shell Integration by default does not include subfolders into comparison. This behavior can be changed with this option. The default behavior can be also changed by holding down the Control key while selecting the Compare... item from the Explorer context menu.

9.4.5. External editor

WinMerge has a pretty good editor for most basic editing needs. However, it doesn't even compare to many other editors in functionality. WinMerge allows user to define one's personally preferred editor to external editor. Files can be opened in the external editor from the directory compare's context menu.

Notepad is used as the default editor, because it is found on all Windows platforms.

[Tip] Tip

Command line parameters can be given, in format: <path to .exe> -option1 -option2 ...

9.4.6. Filter Folder

This option allows user to select own (private) folder for file filters. By default this folder is user's My Documents folder. When new private file filter is created, it is automatically added to this folder.

9.5. Backup Files

This page allows user to select several backup-files related options.

9.5.1. Create backup files in

Selects if backup files are created for folder- and file-compares. In file compare backup files are created whenever files are saved. In folder compare backup files are created whenever files are written over (copied).

9.5.2. Create backup files into

Selects where backup files are created. The default is to create backup files into the same folder than original file. This is usually a good choice. The downside is that removing backup files from big folders can take a lot of work.

The second option allows to define one global folder where all the backup files are created. This allows easy cleanup of backup files. But if there are many files with same filename in different folders, then those files use the same backup file.

9.5.3. Backup filename

The default is to append a .bak extension to the filename. Backup file of file.txt will be file.txt.bak.

The second option allows adding a timestamp to the filename. As the timestamp is almost always unique, this allows creating backups even if there are files with same filename in different folders. And basically this allows tracking the work with the file as every time the file is saved, new backup copy is created. Beware that this can cause a lot of files to be created.

9.6. Archive Support

This page contains download link to 7-zip plugin and contains option related to archive support.

9.6.1. Enable archive file support

Enables or disables archive file support (based on 7-Zip integration).

Like described in Installation section of this manual, there are two different methods how 7-zip can be integrated. Integration method can be changed using this option dialog after install.

9.6.2. Detect archive type from file signature

Enabling this option allows WinMerge to recognize archive files even if their file extension is not known. Basically WinMerge reads beginning of the file and searches for archive-specific signature bytes.

[Tip] Tip

Enabling this option allows WinMerge to recognize and for example Open Office files.

9.7. Codepage options

These options allow selecting codepage WinMerge uses for ANSI files and if codepage should be read from file contents for specific file formats.

9.7.1. Default codepage for ANSI files

These three radiobuttons can be used to select default codepage WinMerge uses when handling ANSI files. Usually default choice of System codepage is best choice. However if user knows that files are not in same codepage than system uses then user can choose different codepage selecting Custom codepage and typing codepage number to textbox next to it.

[Important] Important

This option is read only when files are loaded. Changing this option when the files are open in editor can cause unpredictable changes to files when saving them. Select codepage before loading the files.

9.7.2. Detect codepage info for these files: .html .rc .xml

[Important] Important

Uncheck this option in WinMerge.exe. Characters conversions can result in lossy conversions and the risk is very high. WinMerge.exe can display files only with your current codepage.

This option is interesting when your documents use a codepage different from your current codepage (your current codepage is the codepage of your Windows configuration).

For example, you may merge two Slovak or two Japanese files in an English environment. With the required fonts, and this option set, your Slovak, or Japanese, files will be displayed with Slovak, or Japanese, characters.

Actually, WinMerge detects the codepage for these extensions : .html, .rc (resource files for VC++) and .xml.

WinMerge also detects a codepage difference between the left/right files. To avoid lossy conversions during merge/copy/paste, WinMerge proposes you to ignore the codepage information.

[Caution] Caution

When you paste/copy text to an external application, the external application must use the same codepage as WinMerge does. If your external editor does not support custom codepages, disable this option. Refer to the documentation for your external editor (for copying to WinMerge, Internet Explorer offers codepage selection).

9.8. Import and Export of options

Options can be exported to and imported from file. Currently WinMerge supports Windows ini-file formatted text files. Exporting is done by selecting the Export... button. WinMerge asks for location and filename and then saves the file. Importing is done by selecting the Import... -button.


10. Text Encoding (codepages)

10.1. Common scenarios

  1. Comparing English files coded in ASCII

    You may easily use WinMerge.exe. You may also use WinMergeU.exe (if you are on NT/2000/XP/2003), but it will be slower due to encoding conversion.

  2. Comparing western European files coded in the common windows codepage

    (See FAQ: How do I tell what encoding my file uses) You may easily use WinMerge.exe. You may also use WinMergeU.exe (if you are on NT/2000/XP/2003), but it will be slower due to encoding conversion.

  3. Comparing Unicode files

    You should use WinMergeU.exe (if you are on NT/2000/XP/2003) as it will be at least as fast, and may be faster than WinMerge.exe, in this scenario. Also, WinMergeU.exe correctly handles UTF-8 files, unlike WinMerge.exe. If you are on Win95/98/ME, or if your files are all in English or a western European language, you may get by with WinMerge.exe.

  4. Comparing multilingual files

    You should use WinMergeU.exe (if you are on NT/2000/XP/2003) in order to be able to see the characters from different languages simultaneously. If you are on Win95/98/ME, then you may attempt to view the files in WinMerge.exe, but it is recommended that you do not attempt to merge them.

  5. Comparing East Asian files

    You should use WinMergeU.exe (if you are on NT/2000/XP/2003) in order to correctly display double-wide characters. See the Font section for font recommendations. If you are on Win95/98/ME, then you may attempt to view the files in WinMerge.exe, but it is recommended that you do not attempt to merge them.

10.2. Explanation

Characters (such as "a" or "1" or "&") are represented by computers as numbers, and there is more than one way to do this. A text encoding method is a way to encode the characters into the numbers (bytes) of which a file is comprised. There are four main text encoding families:

  • ASCII

    Each character is one byte in the file. This is an old encoding which only supports English letters, numbers, and puncuation.

  • Windows codepages

    Each character is one byte in the file. These are used by default by versions of the Windows operating system. Examples include:

    • 1252 (windows-1252) Western European (supports many western European languages including English, French, Spanish, and German)

    • 1251 (windows-1251) Cyrillic (supports Cyrillic languages including Russian and Bulgarian)

    • 1250 (windows-1250) Central European (supports central European Latin-scrypt languages including Polish)

    • 1253 (windows-1253) Greek (supports Greek)

  • ISO codepages

    Each character is one byte in the file. These have names such as "ISO-8859-1". Some windows codepages approximate some of these. Examples include:

    • ISO-8851-1 ("Latin-1") This is approximated by windows-1252

  • UCS-2LE (Microsoft's style of Unicode)

    Each character is two bytes in the file. This supports Unicode 2.0, which is most of the characters in the Unicode character set.

  • UTF-8

    Each character may be one, two, three, four, five, or six bytes in the file. This supports the full range of Unicode 3.x.


11. Locale support

WinMerge allows translating the user interface to other languages than English. Several translations have been contributed. Translations are available for the following languages:

  • Portuguese (Brazilian)
  • Bulgarian
  • Catalan
  • Chinese (both Simplified and Traditional)
  • Croatian
  • Czech
  • Danish
  • Dutch
  • French
  • German
  • Hungarian
  • Italian
  • Japanese
  • Korean
  • Norwegian
  • Polish
  • Portuguese
  • Russian
  • Slovak
  • Spanish
  • Swedish
  • Turkish
[Note] Note

The translations cover interface content, including menus, dialogs, tooltips, and messages -- essentially the translation of all the strings displayed. However, they do not provide areas outside of string translation; they do not handle how numbers are divided, or how words are alphabetized. (These issues should be addressed in the conventional Windows manner, which is via the Regional settings in the Control Panel.)

11.1. Selecting language

In order to change the current user interface language, do the following:

  1. Run WinMerge
  2. Select Language from the View menu
  3. Select your language and click OK

Note that the WinMerge user interface instantly updates to the selected language.

11.2. Installing translation

The easiest way to install translations is to select them in the installer. Translations are selected in the 4th installer dialog (Select components). The default install (Typical Installation) does not install translations, but they can be individually selected from the list.

If you don't want to re-run installer, or didn't install WinMerge with the installer in the first place, then WinMerge translation files are available in zipped versions. To install new translation file:

  1. Download the zipped release from WinMerge download site.
  2. If the Languages subfolder does not exist under the WinMerge directory (where WinMerge.exe and/or WinMergeU.exe is located) create it.
  3. Search for *.po files, where * is a language name (Swedish.po for Swedish translation) in the archive file. Extract that file to the Languages subfolder.
  4. Run WinMerge

  5. Select Language from the View menu

  6. Select your language and click OK

11.3. Reporting error in translation

Please submit errors you find in translations as bugs to our bug-list. It would be great if you can provide a corrected version of the translated text also.

11.4. Submitting a new translation

If you would like to add your language to the list, look at the on-line documentation for the details on how to do it. All translations are not complete so it would be nice if you can help improving them. Translating (or improving translation) does not require you to have all compile tools or knowledge of WinMerge internals. Just read instructions from above link. And if you have problems ask help from us in one of WinMerge forums.


12. Plugins

Plugins are extra-features for WinMerge. They are not included in the basic version because they interest few users, or because they do not fit in WinMerge architecture.

Each plugin:

  • is a single file, either a dll or a scriptlet (extension .sct)
  • is installed in the subfolder MergePlugins
  • is easy to install: copy the plugin file in MergePlugins, close WinMerge if it is running, and launch it again

12.1. Three categories of plugins

"Plugins" is a generic name for extra-feature dll or scriptlets. Plugins features are spread over three categories:

12.1.1. Editor complement

Operate custom operations on the currently selected text from the active editor pane.

Example plugin: editor addin.sct (Turn the selection to UPPER CASE or lower case.)

12.1.2. Unpacker - Transform a file to a text format

The plugin transform a file in a viewable format (for example, decompress a file). The original file is not changed. A temporary transformed file is created and loaded in WinMerge.

Sometimes the transformed file can be packed back. (See the plugin details to know if it supports packing back.) Then you may merge and save the transformed file. The packing is done automatically in this case. To avoid problems, you are proposed to change the filename when saving a changed file.

[Note] Note

When you compare folders, WinMerge doesn't need to display the files, but the diffing process can give a different result when you compare compressed and not compressed files (for example, uncompressed files may be identical, but the compressed files may differ if they include the date of creation). WinMerge applies the unpacker in all situations, and you are sure to have the same result when you compare folder, or when you merge two versions of a file.

Example plugin: DisplayXMLFiles.dll (Display XML files nicely, by consistently inserting tabs and linebreaks.)

12.1.3. Prediffer - Preprocess files to hide some differences

The plugin is not apply to the files displayed in the editor. It is applied only to temporary copies of the files, and this copies are then scanned to create the difference list.

Example plugin: IgnoreColumns.dll (Ignore the differences inside given columns, while displaying the characters in these columns.)

12.2. Select and apply a plugin

12.2.1. "Suggested plugin" and "Automatic mode"

Each plugin specifies a list of file extensions (see plugins details for more info). When the file extension, either from the left or from the right file, matches the plugin list, the plugin is called "a suggested plugin".

When "Automatic mode" is on, WinMerge searches for a suggested plugin and applies it if it is avaialble. When two suggested plugins are available for a file, WinMerge applies the first one only (alphabetical order).

[Note] Note

"Automatic Unpacking" and "Auto prediffer" are two separate options. There is no option for editor complements.

12.2.2. Editor complement in folder view

Not available

12.2.3. Editor complement in editor view

Access list from Edit->Scripts->... in the main menu.

12.2.4. Unpacker in folder view

Check Plugins->Automatic Unpacking in the main menu. You need to update the results (F5). Each file is loaded again with its suggested unpacker and compared.

12.2.5. Unpacker in editor view

  1. Open dialog: Select the two files first and then press the Select button right from the field "Unpacker". WinMerge displays the standard dialog for unpacker selection. Use the top combobox to select the plugin. Two generic choices "None" and "Automatic" are also available.

  2. From the folder view when Plugins->Automatic Unpacking is checked: Just double click to open the file. The suggested plugin used during the folder comparison is used to load the file in the editor.

  3. From the folder view, always: Select one file, then main menu Plugins->Edit with Unpacker. WinMerge displays the dialog for unpacker selection. Select an unpacker and press OK, WinMerge opens the editor view and applies this unpacker to load the file. This plugin is forgotten when you close the editor view.

12.2.6. Prediffer in folder view

When the files are selected, right-click to open the context menu. Follow Plugin Settings->Prediffer Settings and select "Auto prediffer" or "No prediffer". Refresh the view (F5) to update the results.

[Note] Note

"Auto prediffer" is a per-file option. Some files in the same folder can be in mode "No prediffer" and some in mode "Auto prediffer". When you change folder during a non-recursive compare, the mode is always reset to "No prediffer".

12.2.7. Prediffer in editor view

  1. From the folder view when "Auto prediffer" is checked for a file: Just double click to open the file. The plugin used during the folder comparison is used in the editor before the diff algorithm.

  2. During an editor session, access prediffer lists with menu Plugins->Prediffer->...: The active prediffer is checked. Suggested plugins are indicated first above the not-suggested ones. The files are compared again after the selection, you don't need to rescan.

12.3. Available plugins

12.3.1. CompareMSExcelFiles.dll

Displays the text content of a Microsoft® Excel file, stripping away all formatting and embedded objects.

Categorie: Unpacker
File filter: *.xls
Packing: No
Requirement: Microsoft® Excel, Visual Basic runtime library

12.3.2. CompareMSWordFiles.dll

Displays the text content of a Microsoft® Word file, stripping away all formatting and embedded objects.

Categorie: Unpacker
File filter: *.doc, *.dot
Packing: No
Requirement: Microsoft® Word, Visual Basic runtime library

12.3.3. DisplayXMLFiles.dll

This plugin display XML files nicely, by consistently inserting tabs and linebreaks. This is to fix XML files which do not have line returns in convenient locations.

Categorie: Unpacker
File filter: *.xml
Packing: No

12.3.4. editor addin.sct

Add two functions to the Edit->Scripts menu:

  • MakeUpper convert the selection to UPPER CASE.
  • MakeLower convert the selection to lower case.

Categorie: Editor complement

12.3.5. IgnoreColumns.dll

The plugin ignore the characters at specified columns. It does not support files with tabulations (no crash, but all tabs will be treated as a normal character). The first column has number 1.

For the parameters, you just need to rename the dll with the following syntax:

  • Delimiters between ranges: _ or ,
  • Delimiters between min and max: anything else
  • Min and max are included.
  • When max = min, max may be omitted.

Example 6. IgnoreColumns.dll syntax

IgnoreColumns _ 3 _ 10 - 20 _ 32 - 33.dll
Ignore all characters at column 3, and in columns 10 to 20, and 32 to 33.
IgnoreColumns_1,30 to 40.dll
Ignore all the characters in column 1, and in columns 30 to 40.

Categorie: Prediffer
File filter: *.txt

12.3.6. IgnoreCommentsC.dll

The plugin ignores comments (//... and /* ... */) in C, C++, PHP and JavaScript files.

Categorie: Prediffer
File filter: *.cpp, *.cxx, *.h, *.hxx, *.c, *.php, *.js

12.3.7. IgnoreFieldsComma.dll

The plugin is for files with fields and comma as delimiters (CSV files for example). It ignore the characters in the specified fields. First field has number 1.

Modify the filename to specify the fields. See IgnoreColumns.dll for the syntax.

Categorie: Prediffer
File filter: *.csv

12.3.8. IgnoreFieldsTab.dll

The plugin is for files with fields and tabulations as delimiters (Excel files saved in format *.txt for example). It ignore the characters in the specified fields. First field has number 1.

Modify the filename to specify the fields. See IgnoreColumns.dll for the syntax.

Categorie: Prediffer
File filter: *.txt

12.3.9. IgnoreLeadingLineNumbers.dll

This plugin ignores the leading line numbers in text files (for example NC and BASIC files).

Categorie: Prediffer
File filter: *.nc
Requirement: Visual Basic runtime library

12.3.10. insert datetime.sct

Add two functions to the Edit->Scripts menu:

  • InsertDate insert date in the current locale format.
  • InsertTime insert time in the current locale format.

Categorie: Editor complement

12.3.11. RCLocalizationHelper.dll, RCLocalizationHelperU.dll

The plugin preprocesses RC files by stripping out localized strings, to enable comparing differnt language versions of the same RC file and ignoring the translations.

RCLocalizationHelperU.dll is the Unicode version.

Categorie: Prediffer
File filter: *.rc

12.3.12. WatchBeginningOfLog.dll, WatchEndOfLog.dll

For long LOG files, the user is often interested only in the first lines or in the last lines.

  • WatchBeginningOfLog.dll truncates the files to the first 1/10th.
  • WatchEndOfLog.dll truncates the files to the first 1/10th.

Categorie: Unpacker
File filter: *.log
Packing: No

Developers may find information and code of examples in the source package, under the folder "Plugins".

12.4. Requirements

12.4.1. Windows Script Host

Some editor complements need this optional component from Microsoft®.

If the list of editor complements does not present all editor plugins, this component is probably missing. You can check easily. WinMerge informs you with a comment at the bottom of the list. You may install WSH on any version of Windows (need IE 4.0). Download it from MSDN Library.

12.4.2. Visual Basic runtime library

Some plugins require Visual Basic runtime library to work.

You can download the required file msvbvm60.dll or use the Run-Time Redistribution Pack from Microsoft®. If you don't need the plugin, you can safely remove it.


13. Filters

There are two kinds of filters in WinMerge: file filters for filtering files and folders in folder compare and line filters for ignoring lines from files before comparing.

13.1. Regular expressions

Filters are based on regular expressions (regexps). Each line filter or file filter rule is regexp which is matched against file/folder name or line.

Regexps can be very complex to read. Luckily most file filtering needs are for file extensions. File filters installed with WinMerge have many useful examples.

WinMerge uses popular PCRE (Perl Compatible Regular Expressions) regular expression engine. There are lots of resources for help with Perl regular expression.

13.1.1. Help with regexps

There are many guides and help sites in Web, for example:

Good site devoted for regexps:
http://www.regular-expressions.info/
Good HOWTO document for regexps:
http://www.amk.ca/python/howto/regex/
Tutorial:
http://www.zvon.org/other/PerlTutorial/Output/index.html
PDF quick reference:
http://www.night-ray.com/regex.pdf

13.2. File filters

A file filter is a set of rules saved to one file. Every file and folder is tested against all these rules before comparing. Files and folders that match the rules are excluded if it is an inclusive filter, or included if it is an exclusive filter.

[Tip] Tip

Ignored items have "Skipped" status in folder compare. User can select them to visible or hidden from View menu. Usually its wise to keep skipped items hidden.

WinMerge's filtering system allows only one filter set to be active at a time. Active filter set can be selected from Open-dialog or from menu: Tools->Filters. Also empty filter can be selected when no folders or files are ignored.

Filtered out files get only minimal needed attention by the folder compare. This means that WinMerge misses a lot of information it gets for non-ignored files. For example there is no way to know if filtered file is a text file or a binary file. The reason is simple: as user tolds WinMerge one does not care about the file, WinMerge tries to minimize the effort and time for the file.

13.2.1. Filter files

Filter files are normal text files, with an extension of .flt. Files have defined format which is explained later in this chapter. Filters-dialog allows creating new filter files based on template file. Filter files can be created from the scratch but using template file is the recommended way to create a new filter. The template file is named FileFilter.tmpl and can be modified if needed. The template file is located in WinMerge/Filters -folder.

Filter files have two possible locations:

  • "Filters" subfolder in the WinMerge program folder. E.g. C:\Program Files\WinMerge\Filters.

  • User-defined folder. Selected in Options (Edit->Options->System+Filter Folder). By default it is My Documents\WinMerge\Filters folder.

[Important] Important

With WinMerge 2.6.0 and later filter files are not anymore loaded from profile folder like with earlier versions. Using user-defined folder for filter files provides more flexibility and easier access to filter files.

First part of filter file defines name and basic functionality of the filter:

name: Example filter
def: include

where def: is:

  • include - inclusive filter. This filter type filters out files and folders that match rules in filter.

  • exclude - exclusive filter. This filter type lets through files and folders that match rules in filter.

When using exclusive filter its worth noting that the filter must contain rule to include all wanted subfolders. Usually its wise to use this rule to include all subfolders:

d: \\*$ ## Subfolders

There can be one filter rule in one line. And rule cannot be split to several lines. Common format for one filter line is like this:

f: \.ext$ ## Match files *.ext

or

d: \\folder$ ## Match given folder name

Rule begins with "f:" if it matches for filenames and "d:" if it matches for folder names. (d comes from "folder".) Filenames are given to filter as is, there are no special characters added. Folder names have preceding backslash before them (e.g. "\Folder name"). So if folder names are matched by the beginning of the name, the filter must start with "\\" to match the first backslash. "##" is a comment separator, all characters in line after that are ignored by WinMerge.

[Note] Note

File filter rules are case-insensitive. Rule .\bat$ matches to winmerge.bat and compare.BAT.

So simple filters can be for example:

Example 7. Simple filefilter rules

f: \.cpp$ ## Match *.cpp files
f: \.h$ ## Match *.h files
f: ^My ## Match My*.* files
f: Dlg\. ## Match *Dlg.* files
d: \\test$ ## Match 'test' folders
d: ^\\Build$ ## Match 'Build' folders
d: Temp$ ## Match *Temp folders (e.g. FirstTemp)
d: Src ## Match *Src* folders

Line begin or -end marker ("^" or "$") is usually required filter to work correctly. Dot in filename must be "escaped" with "\" so "\." means dot in filename.

[Note] Note

Don't forget "$" at end. It marks end of folder- or filename and without it rule may not work like expected. While "\.c$" matches with only filenames having extension .c "\.c" matches all extensions beginning with "c" (.cpp, .com, etc).

Since file filter rules are regular expressions more complex rules are also possible. Following few rules show some possibilities for more complex rules:

Example 8. More complex file filter rules

f: ^\.#.*$ ## .#filename.version files
f: Dlg\.c(pp)?$ ## *Dlg.c & *Dlg.cpp files
f: ^I.*\.h$ ## I*.h files
f: Srv[1-9]\.def$ ## *Srv1.def - *Srv9.def files
f: ^[h,k,m] ## h*.* & k*.* & m*.* files

WinMerge ignores most whitespace characters in rules definition lines. However comment must always start with one or more whitespace character (space or tabulator) and comment-marker (##). ## can be used as part of rule if there is no whitespace character before it.

13.3. Line filters

Line filters can be used to ignore single lines from compared files. Line filters are handy when user doesn't want to compare comments or certain generated code. For example version control system (time)stamps.

[Important] Important

Line filter rule ignores single line it matches. It is not possible to ignore partial lines or several lines with file filter rule. Also, all lines in difference must match the filter so that difference is ignored. If only one line of several matches, the difference is not ignored.

In file compare ignored differences are shown with own colors to differentiate them from other differences. User can see these differences but cannot select or merge them.

Line filter rules are regular expressions like file filter rules. Since filter matches if any part of line matches it is usually recommended to add begin ("^") or end ("$") marker to rule. Or both markers if exact line is wanted to filtered.

Rules can be added and edited in Filters-dialog (Menu: Tools->Filters). Type one rule per row to the list. At the beginning of the row is a checkbox for enabling / disabling single rules.

Compare results are not updated automatically after changing line filter rules. User can update compare results by selecting Edit->Refresh or F5.

Example 9. Some example line filters

^MYTAG$

- Filters out lines being exactly "MYTAG"

^::

- Filters out lines beginning with "::"

^/\**.\*/$

- Filters out lines beginning with "/*" and ending with "*/"

^[1-5]00

- Filters out lines beginning with numbers 100, 200, 300, 400 & 500

Example 10. Line filter rule matching CVS "Id:" -lines:

Id-lines are like this:

// $Id: Filters.xml 4884 2008-01-09 15:42:23Z kimmov $

And they can be filtered with rule:

^// \WId: .*\$

Example 11. Filter out line number comments in po files:

po line number comments are like this:

#: src/filename.c:766

And they can be filtered out with rule:

^#


14. Version control integration

WinMerge provides basic integration with Visual SourceSafe and ClearCase version control systems. Integration means WinMerge checkouts file edited from version control. User can later checkin changed file with version control system's tools. WinMerge does not provide history or checkin tools.

Version control support relies on fact that files in version control system are read-only in local disk. So if local file is read-only and version control integration is enabled WinMerge assumes file is version controlled and shows checkout dialog.

14.1. Visual SourceSafe

To enable Visual SourceSafe integration for version controlled directory:

  1. Enable Visual SourceSafe integration from Edit->Options+Versioning System

  2. Open version controlled file/directory to WinMerge

  3. Edit version controlled file

  4. Save changes - now WinMerge detects file is read-only and assumes it is under version control. WinMerge shows following dialog:

WinMerge searches for SourceSafe databases from system and fills them to first dropdown list in dialog. So you first have to select right database if there are more than one databases in your system.

Project path is file path relative to SourceSafe database base path. Be careful with this since most errors are because of wrong project path. Keep in mind that when you change folder you have to change project path too!

WinMerge remembers password for current session, but does not store it. So you don't need to retype password again in same session. But after closing WinMerge you have to retype password. This is to keep your password safe!

Apply to all items -checkbox allows to checkout several files when copying files in directory compare. All files must reside in same directory to use this feature.

Unfortunately, VSS is horribly silent about error conditions (other than the fact that one occurred). If an operation fails, one of the following conditions could be at fault:

  • Another user may have the file checked out with exclusive access

  • You may have specified the wrong project

  • You may have entered the project name incorrectly

  • Did you use VSS path syntax (ie: $/MyProject/res)

  • Your connection to the VSS server computer may be hosed


15. Command Line

WinMerge accepts several parameters from command line, in addition to paths to compare. Most of these parameters are intended for using WinMerge as an external compare application. Or for starting from batch files.

Syntax for the command line is:

WinMerge [/r] [/e] [/f filter] [/x] [/s] [/ul] [/ur] [/ub] [/wl] [/wr] [/minimize] [/maximize] [/dl leftdesc] [/dr rightdesc] leftpath rightpath [outputpath]

All parameters start with "/" or with "-" prefix character. Pathnames don't have any prefix character.

  • /? opens this help.
  • /r tells WinMerge to compare folders recursively . Normally WinMerge does not compare subfolder contents but does the "flat" compare showing the files in compared folders and subfolders as separate items. Using /r tells WinMerge to compare all files in all subfolders. When subfolders are included, only unique subfolders are visible as separate items in compare results. Note that including subfolders can increase compare time remarkably.
  • /e allows WinMerge to be closed with a single Esc keypress. This is useful when using WinMerge as an external compare application. WinMerge can act like an dialog which is easy and fast to close.
  • /f allows selecting filter used. Filter can be filemask like "*.h *.cpp" or name of filefilter like "XML/HTML Devel". Quotation marks must be used if filter mask or name contains spaces.
  • /x closes WinMerge if opened files are identical (after information dialog is shown). This parameter is useful when WinMerge is used as an external compare application. It helps to faster process and/or ignore files which don't have any differences. Note that this option does not apply when files become identical when merging/editing them.
  • /s enables single-instance behavior. If there is already WinMerge running new compare is opened to that same instance. Depending on other settings (if multiple windows are allowed) new compare is opened to existing or new window.
  • /ul tells WinMerge to not add left path to MRU. External applications should not add paths to Open-dialog's MRU lists.
  • /ur tells WinMerge to not add right path to MRU. External applications should not add paths to Open-dialog's MRU lists.
  • /ub tells WinMerge to not add both paths to MRU. External applications should not add paths to Open-dialog's MRU lists.
  • /wl initially opens left side as read-only. Use this when you don't want to change left-side items in compare.
  • /wr initially opens right side as read-only. Use this when you don't want to change right-side items in compare.
  • /minimize starts WinMerge as minimized. This option can be used to start WinMerge minimized for lengthy compares.
  • /maximize starts WinMerge as maximized.
  • /dl adds a description for left side shown instead of folder / filename. This allows showing version number or label for compared items. Like "Version 1.0" or "Work Copy".
  • /dr adds a description for right side shown instead of folder / filename. This allows showing version number or label for compared items. Like "Version 1.0" or "Work Copy".
  • leftpath is the folder or filename to open on the left side.
  • rightpath is the folder or filename to open on the right side.
  • outputpath is an optional output folder where you want merged files to be saved.
[Tip] Tip

WinMerge accepts filename and folder name as path parameters, as long as the given folder contains file with same name than in first parameter.

For example, one can give a command: WinMerge C:\Folder\File.txt C:\Folder2. If C:\Folder2 contains file named File.txt WinMerge now compares files C:\Folder\File.txt and C:\Folder2\File.txt

Usually WinMerge requires that both path parameters (leftpath and rightpath) point to folders or files. It is not possible to compare folder to file (except in case described in above note). If WinMerge cannot find any of given paths, it opens Open-dialog.

Third path given in command line is rarely needed when WinMerge is started from command line. It is meant to be used with many version control tools which use third path as a "result" file. WinMerge always shows two files in file compare, the third path is a path where any of these files gets saved into, leaving other two paths intact.

Usually these tools use terms like "theirs", "mine" and "merged "/ " resolved" about these three files. And those paths should be given in that order for WinMerge.

15.1. Conflict File

Conflict file can be given to command line as one path to the conflict file. There cannot be second or third path with conflict file. After WinMerge opens the given conflict file, it can be resolved like described in Resolving Conflict Files.


16. Frequently asked questions

16.1. General questions

16.1.1.

Why are there two executable files, WinMerge.exe and WinMergeU.exe?

  • WinMerge.exe is an ANSI (8-bit) executable which works in all 32-bit Windows systems. It does not have Unicode support.

    Internally, it stores only ANSI characters (256 possibilities). If you open a Unicode file, the characters must be converted to the ANSI codepage. As there are over 100,000 Unicode characters, and only 256 can be represented in the ANSI codepage, data loss may occur. Conversion may be approximative (accents are lost), or impossible (characters appear as "?").

    WinMerge.exe also can not open files with names outside the current ANSI codepage (e.g., WinMerge.exe can not open a file with a Hebrew name, if run on an English system. WinMergeU.exe can open such files.

  • WinMergeU.exe is a Unicode enabled executable which works on Windows NT4, Windows 2000, and newer systems.

16.1.2.

That splash screen is annoying, how do I turn it off?

From menu, select Edit->Options...->General->Disable Splash Screen
16.1.3.

When wanting to compare folders, I cannot select a folder in Browse-dialog?

Browse to the folder you want to compare (folder contents is shown in the dialog). Do not select any of the files or subfolders, just select the Open-button when "Folder Selection" is shown in filename editbox. If you already selected any of the files or subfolders, just write some nonsense to the filename editbox and select the Open-button. When the filename editbox doesn't contain any existing filename then WinMerge opens the folder.

16.1.4.

Does WinMerge support merging three files? Sometimes it is called 3-way merge, where one file is ancestor. This would be useful for version control!

Unfortunately not. We acknowledge it would be good feature but have no plans to implement it in near future. This can be somewhat worked around by using two WinMerge instances. Or using third path parameter given from command line. See Command Line -chapter for more information.

16.1.5.

Do you have any plans to support other operating systems than Windows?

Not currently. If somebody wants to help/work with cross-platform support (using wxWidgets for example) we are interested, of course.

16.1.6.

There is no CVS integration?!

Which kind of CVS integration WinMerge should have? Adding CVS client features to WinMerge is questionable since there are many good CVS clients already. WinMerge can resolve conflict files, see Resolving Confilict Files.

16.1.7.

What is MRU (list)? What it means?

MRU is the abbreviation for "Most Recently Used", and means the history lists in the Open-dialog which contain the 20 last used files/paths per side.

16.1.8.

Can WinMerge open Open Office files?

Yes, enable Detect archive type from file signature option in Archive Options.

16.1.9.

Why do large files sometimes show as different in the folder view, but come up as identical in the merge editor?

This is because WinMerge uses the "Quick Compare" method for large files always. It allows WinMerge to compare large files more efficiently. To test if this is causing the behavior you're seeing, you could raise the limit for the Quick Compare threshold for large files. It is stored in the registry as:

HKEY_CURRENT_USER\Software\Thingamahoochie\WinMerge\Settings\QuickMethodLimit

You may consider raising this limit if you constantly compare large text files. Be careful to not raise it too much "for just to be sure". 100 MB is too much.

The default value for the limit is 4MB (0x400000).
16.1.10.

WinMerge shows an error (or even crashes!) complaining it cannot load CompareMSWordFiles.dll and/or CompareMSExcelFiles.dll!

Mentioned files are plugins written with Visual Basic (6.0). WinMerge installer does not contain Visual Basic runtime files so those plugins cannot be loaded. You can:

  1. Remove those files from WinMerge/Plugins -folder or

  2. Download the Visual Basic 6.0 runtime distribution from Microsoft®:http://support.microsoft.com/kb/290887 and install it. Or download just the one needed file from: http://www.dll-files.com/dllindex/dll-files.shtml?msvbvm60 and copy it to the WinMerge folder.

16.2. Installing

16.2.1. | WinMerge does not start and complains about missing DLL files (mfc71.dll, mfc71u.dll, msvcr71.dll, msvcp71.dll)
 | When installing from archive (zip, 7z) file you need also Runtimes-package, which contains those files. See the Install instructions.

16.3. File Comparing

16.3.1. | Why my files have all lines marked different (colored) even if I know all lines are not different?
 | Maybe your files have different line-ending styles (e.g. Windows and Unix?). WinMerge by default compares also line-ending styles, but you can disable it from Edit->Options / Compare / Ignore carriage return differences.

16.4. Questions about editor

16.4.1. | Some characters are cut in half?
 | Try selecting a different font from menu View->Select Font...
16.4.2. | I see question marks instead of letters in files?
 | This is what we call a "lossy" conversion. For Unicode files (UCS-2, UTF-8), use WinMergeU.exe. For ANSI files, this is probably due to code-page problems. If "Use codepage info" is selected from Options, turn that off and see if it helps.
16.4.3. | I cannot select proportional fonts for editor?
 | Unfortunately WinMerge supports only non-proportional fonts.
16.4.4. | What is delaying of (automatic) rescan? Why it is needed?
 | When Automatic Rescan is enabled, WinMerge delays rescanning while user edits files. So there is no rescanning happening when user types text but shortly after user has finished typing. Without this delaying WinMerge would do rescan after every typed letter and editing files would become slow. This delaying especially improves editing of bigger files which can take several seconds to rescan.
16.4.5. | Can I print files from editor?
 | There is basic printing support in WinMerge 2.6.0 and later versions. Select File->Print... from the menu.
16.4.6. | Can I hide similar lines in editor (so that only different lines are visible)?
 | No, you can't. Many users have requested this feature but we don't have any plans to implement it. We don't believe it would really improve usability.

16.5. WinMerge as external compare or diff-tool

16.5.1.

I want WinMerge to close with a single ESC press after I'm done?

Use -e command line switch.

16.5.2.

I don't want to see the "Files Are Identical" -messagebox when I compare identical files, I just want WinMerge to quit.

Use -x command line switch.

16.5.3.

How can I avoid temporary paths filling Open-dialog history lists?

Tell your external program to invoke WinMerge with the /ub option, which tells WinMerge to not add the files to the MRU.

16.5.4.

But the program I'm using doesn't allow commandline parameters!

Create a batch file where you add one of these lines (but not both):

  • CALL "<winmerge path>\WinMerge" /ub %1 %2
  • start "WinMerge" "<winmerge path>" /ub %1 %2

And then call this batch file from program.

16.6. Archive support

16.6.1. | I installed 7-Zip but archive support does not work?
 | Do you have plugin installed and or the plugin version matches 7-Zip version? If not, see Installing chapter for instructions for installing.
 | If the error is something like: "7-zip x.xx missing / Plugin present", then you probably have installed 7-Zip using MSI-installer. There are 7-Zip MSI installers that do not install all the files WinMerge needs (namely 7zip_pad.xml in 7-Zip program folder). Download and run the EXE version of the 7-Zip installer.
16.6.2. | How can I open "Perry-style" patch files WinMerge developers use when submitting patches?
 | "Perry-style" patches are zip-files containing original and changed files in different directories. WinMerge has internal support (surprise?) for handling these files. Just select zip file in question to left side and right side and WinMerge opens zip files contents to folder compare comparing original and altered files.
16.6.3. | I do not want to install 7-zip. Can archive support use other archive tools (like WinZip or WinRar)?
 | Unfortunately WinMerge can only use 7-zip.
16.6.4. | Can WinMerge open archive files with non-standard file-extensions? (For example .jar files as zip-files)
 | Yes, enable Detect archive type from file signature option in Archive Options.

16.7. Text encoding (codepages)

16.7.1.

How do I tell if my file is coded in the local windows (ie, ANSI) codepage?

Open the file with Windows notepad (eg. Start->(All) Programs->Accessories->Notepad. Choose File->Save As, and in the Save As dialog which appears, look at the dropdown list at the very bottom, labelled "Encoding".

  • If it says "ANSI", the file is (apparently) in the local windows codepage. If the file is entirely in English and normal punctuation, then the file is also in ASCII.

  • If it says "Unicode", the file is (probably) in the default Windows Unicode encoding "UCS-2LE".

  • If it says "UTF-8", the file is in the cross-platform Unicode encoding "UTF-8".

  • If it says "Unicode big endian", the file is in a different Unicode encoding not much used or supported under Windows, probably "UCS-2BE".

16.7.2.

How do I compare UTF-8 files? WinMerge is not showing them correctly.

Using WinMerge encoding detection.

  • If they are XML files, they should have an encoding attribute in the XML declaration, which should say "UTF-8". For example:

    <?xml version="1.0" encoding="UTF-8"?>

  • If they are HTML files, they should have the encoding embedded in a content attribute in a meta tag in the header. For example:

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

  • For WinMerge to read encodings specified in XML or HTML (or Windows RC resource) files, the option checkbox Detect codepage info for... in Codepage options (Edit->Options from main menu) must be checked.

For all other cases, to instruct WinMerge to assume that all documents are UTF-8, set the default WinMerge codepage to 65001 (which is Microsoft's code for UTF-8) in Codepage options (Edit->Options from main menu) and then Custom Codepage.

16.8. Patch files

16.8.1. | Is there way to create patch files from the commandline?
 | No. It may be added in later versions but until then Win32 port of diffutils can be used. The Win32 port of diffutils (and patch) can be downloaded from GnuWin32 project from SourceForge: http://sourceforge.net/projects/gnuwin32
16.8.2. | Can patches be applied using WinMerge?
 | No. The patch tool from GnuWin32 project can be used for patch applying since WinMerge produces GNU/diffutils compatible patch files. See above question.


A. Shortcut keys

Most common shortcut keys familiar from other Windows applications work in WinMerge.

Table A.1. Folder compare

Key | Function
Enter | Open selected item (if folder, open it)
Backspace | Open parent folder if possible (only available when subfolders are not included in compare)
F5 | Rescan folders
Alt-Home | Go to first different file/folder
Alt-End | Go to last different file/folder
Alt-Enter | Go to currently selected item (if scrolled off-screen)
Alt-Up Arrow | Go to previous different file/folder
Alt-Down Arrow | Go to next different file/folder
Alt-Left Arrow | Copy selected items from right to left
Alt-Right Arrow | Copy selected items from left to right

Table A.2. File compare

Key | Function
Esc | Close window (if enabled in options)
F4 | Show line difference
F5 | Refresh
F6 | Change pane (active file)
F7 | Go to previous difference
F8 | Go to next difference
F9 | Turn Merge mode on/off
Ctrl-G | Go to difference or line
Ctrl-Z | Undo last action
Ctrl-Y | Redo previously undone action

Table A.3. Difference navigation and merging (normal mode)

Key | Function
Alt-Home | Go to first difference
Alt-End | Go to last difference
Alt-Enter | Go to current difference or select difference
Alt-Up Arrow | Go to previous difference
Alt-Down Arrow | Go to next difference
Alt-Left Arrow | Copy difference from right side to left side
Alt-Right Arrow | Copy difference from left side to right side
Ctrl-Alt-Left Arrow | Copy difference from right side to left side and select next difference
Ctrl-Alt-Right Arrow | Copy difference from left side to right side and select next difference

Table A.4. Difference navigation and merging (merge mode)

Key | Function
Up Arrow | Go to previous difference
Down Arrow | Go to next difference
Left Arrow | Copy difference from right side to left side
Right Arrow | Copy difference from left side to right side
Ctrl-Alt-Left Arrow | Copy difference from right side to left side and select next difference
Ctrl-Alt-Right Arrow | Copy difference from left side to right side and select next difference

Table A.5. Find and Replace

Key | Function
Ctrl-F | Find text
Ctrl-H | Replace text with another text
F3 | Find/Replace again.
Shift-F3 | Find/Replace upwards in file
Ctrl-F3 | Find selected text in file
Ctrl-Shift-F3 | Find selected text upwards in file

Table A.6. Bookmarks

Key | Function
Ctrl-F2 | Toggle Bookmark
F2 | Next Bookmark
Shift-F2 | Previous Bookmark
Ctrl-Shift-F2 | Clear All Bookmarks
Alt-0 | Goto Bookmark 0
Ctrl-0 | Toggle Bookmark 0
Alt-1 | Goto Bookmark 1
Ctrl-1 | Toggle Bookmark 1
Alt-2 | Goto Bookmark 2
Ctrl-2 | Toggle Bookmark 2
Alt-3 | Goto Bookmark 3
Ctrl-3 | Toggle Bookmark 3
Alt-4 | Goto Bookmark 4
Ctrl-4 | Toggle Bookmark 4
Alt-5 | Goto Bookmark 5
Ctrl-5 | Toggle Bookmark 5
Alt-6 | Goto Bookmark 6
Ctrl-6 | Toggle Bookmark 6
Alt-7 | Goto Bookmark 7
Ctrl-7 | Toggle Bookmark 7
Alt-8 | Goto Bookmark 8
Ctrl-8 | Toggle Bookmark 8
Alt-9 | Goto Bookmark 9
Ctrl-9 | Toggle Bookmark 9

Table A.7. Zoom

Key | Function
Ctrl-+ | Increase text size
Ctrl-- | Decrease text size
Ctrl-* | Reset text zoom to default size
Ctrl-MouseWheel Up | Increase text size
Ctrl-MouseWheel Down | Decrease text size