In an earlier post on creating child themes for WordPress, I said that if you had already made changes to your theme, you could use a program like WinMerge to find the differences between a clean copy of your theme and the copy you’ve been editing.
The time has come to show just how that is accomplished.
Your first step is to go to the WinMerge site, download WinMerge, and install it.
Next, you’ll need two files to compare. For our example, I used the 3.1.1 and the trunk tags of the Akismet plugin for WordPress. (I was trying to learn how to use Subversion at the time, and went to a plugin I knew was done properly to see how they set things up. Seeing how others do something and then doing likewise is a great way to learn things.)
Once you open WinMerge, go to File >> New, and go to File >> Open to bring up a dialogue box to select your two files:
Select one file for “Left:”, another file for “Right:” and then click okay. You’ll see something like this:
There is only a single difference between these two files. The location pane is showing us where that difference is:
The two file panes show us that difference in each file. In this case, the 3.1.1 tag file is missing something:
that the trunk tag file contains:
It’s that simple, although if you have a file that you have made a lot of changes to, you will see a lot more red and pink than this example.
Other Super Powers
Not only can WinMerge show you the difference between two files, it can also merge those two files together. It can also show the differences between two folders, which is very handy. Interested? View the one-page tour, or read the manual. I’ve found all sorts of uses for WinMerge, and I’m sure you will too.
Support This Site
I don’t run ads on this site, so if you found this post useful or enjoyable, please support this site by sharing this post on your favorite social media by using the buttons above. If you would like to contribute to the server costs, you can also contribute via PayPal at paypal.me/kjodle. I appreciate your support.