Référencement SEO - Search engine optimization

WinMerge, compare 2 files or 2 folders

Published by Arf, 2020/02/29

You are a developer, a webmaster, a hacker, a writer, a student... and you have two different versions of a file (old and new version of a script, a document...). Or you are simply someone who asks himself the following question(s):
How to compare two files or two folders easily?
How to update these 2 files, selecting different parts of each, to finally form a single file?

The answer can be found here, in this tutorial, so welcome.
WinMerge is convenient, easy to use, free, open source and available in many languages.

1/ Downloading Winmerge software

This step may seem simple at first glance, but it can be more complex than you may or may not realize. I give you the link to download Winmerge, don't thank me right away, the donation button is at the end of the article. Download Winmerge.

2/ Installing Winmerge

If you followed step 1, you got lost on the Winmerge site for a few seconds or several minutes in order to download the software that will make it easier for you to manage your files and folders, you made a donation to them, and then you installed it.

After the installation, Winmerge opens. If not, launch it, you are now on the Winmerge interface which should look like the image below.

WinMerge interface

So you're ready to use it, yoshaaaaa, let's get started.

3/ How to use Winmerge

You are ready, you will be able to compare 2 folders or 2 files very easily. Just follow the guide.

At the very top left of the interface, click on "File", then "Open", you get the window below:

WinMerge

This window allows you to choose two folders or two files to compare.
Here, I choose to compare two folders. By choosing to compare two folders, I will be able to compare all the files with the same name. This feature is very useful in this case, since I compare two versions of the Arfooo directory script, the version 1.0.9 and version 2.0.0
Two versions really very different.

a/ Select the file to compare which will be in the left window (personally I always put in the left window the old version).
b/ Select the file to be compared which will be in the right window (personally I always put in the right window the new version).
c/ Select a filter if you need it, here it is not the case, so leave it by default.
d/ Do not check this box, otherwise when you open the next window, you will find yourself with all the files to compare on a single window, with Arfooo Directory, you will have about 1300 files on a single window.

You understand that it quickly becomes a mess, it would be completely unreadable. Press Ok, you get the following window, you can walk through all the subdirectories very easily.

WinMerge: comparing two files

If the files are not identical, you know it immediately:
- For text files (.doc, .txt, .php. tpl. css...), you get the following message: "the text files are different".
- For image files, binary, you get the following message: "Binary files are different".
A special case that you will probably encounter if you use php, js, ajax... scripts is the fact of having a file or a folder only on the right or on the left. This case appears if a folder has been deleted or added.

You quickly see in macro version, the different files and folders that have been modified, added, or deleted.
Now for with a micro vision, and to see exactly the differences between 2 files, make a right click on a file, then "Compare".
A window opens, you get this :

See the difference between 2 files with Winmerge

WinMerge

On the left the old version (1.0.9), on the right the new version (2.0.0).
Different colors appear, but what's all that.

Don't panic, here are some explanations :
White line: no modification between files.
Dark yellow line: Line not identical between the 2 files (a simple warning)
Clear yellow line: Accurate detection of modified, deleted or added items.
Grey line: Line not found in one of the 2 files. No match. This line therefore indicates that an entire line has been added or deleted.

Small tips :
- In "Edit", "Preferences", then "Comparison", you can refine the file comparison according to your preferences, your needs and your personal logic.
- Use the Ctrl key + scroll wheel of your mouse to shrink or enlarge the text size of the compared files.

4/ Thank you for your attention

The tutorial ends here, don't be sad, you have just learned a few tricks, precisely to use Winmerge. I hope this tutorial and this software will be useful for you.

0 comments for WinMerge, compare 2 files or 2 folders

Add comment
Name
Url
captcha
   Generate a new code
Google Ads
 
Copyright © arfooo.net  2007 - 2010  -  All rights reserved.
Partners: petites annonces gratuites   voyance gratuite   referenceur freelance