15

I need a suggestion for a code comparison tool.

  • It should be able to compare a website code with a local copy (via FTP)
  • It should be able to visualize the source code highlighting the differences
  • It should be able to synchronize the oldest with the newest
  • It should be able to filter out unwanted files and folder (images/cache/database etc) - just code -

Preferences are for a freeware tool, of course, but a small sum could be allocated from the budget.

The client PC is a Windows system, but, of course, the server side could be anything that supports FTP.

To better precise the requirements I should add that those above are pretty indispensable in my context. I work from the home desktop, from a notebook when away and sometime also from the office dev desktop. It is increasingly difficult to keep everything in synch and trace all the changes. Finding the right tool that let me see the difference with the testing live site and the various development machines is a must.

Of course the comparison should be made on the folders content starting from the root of the site but excluding folders for images and other non coding data to not waste time on files that I usually don't touch.

3
  • 3
    Have you seen this comparison chart on Wikipedia?
    – Ben Miller
    Feb 19, 2014 at 16:18
  • @BenMiller wow thanks, I did not know there were so many choices. Appreciate it, but now... I couldn't test them one by one.
    – Steve
    Feb 19, 2014 at 16:35
  • Looking at the chart, there are only 7 products that both support FTP and run on Windows, and only two of those are open-source/GPL. So you might want to start there, if you don't get a good recommendation. (I use WinMerge, but it doesn't do FTP.)
    – Ben Miller
    Feb 19, 2014 at 18:25

2 Answers 2

6

Beyond Compare should do all you ask for. .

It should be able to compare a website code with a local copy (via FTP)

The standard version $30 supports FTP, but I think you need the Pro version $50 if you want SFTP

It should be able to visualize the source code highlighting the differences

Check. It also has syntax aware viewers so you can (if you want) ignore un-important changes (eg indenting in source code)

It should be able to synchronize the oldest with the newest

You can configure the system to, for example show only files that are different, or just files that are newer (including or excluding orphans). Also has one of two way synchronization.

It should be able to filter out unwanted files and folder (images/cache/database etc) - just code -

You can include or exclude files or folders by file mask (eg *.jpg or /images/)


I have used it for years for all four of your points, although in separate contexts and in my case the source code is mainly C# code.

It has a 30-day trial so you can try it for yourself.

1
  • Yes, I have already made the decision to buy the PRO version, It stands out for price and completeness against any one of the tools listed in the reference of Mr Miller
    – Steve
    Feb 25, 2014 at 13:04
1

You most likely will have to use various tools together. One that finds you the differences and one that does the diff etc. I know a tool that does the diff and one that finds the files, both are only medium well for your situation.

For the job of comparing two files (where one or both may be on different machines) I use VimDiff (more precisely the gui thing "GVimDiff") for this. It ships together with gvim and is available on windows.

If you are unfamiliar with an editor of the vi/vim family prepare for a steep learning curve!

To compare two files, open the local one in gvim (from the explorer "Open with" or by opening vim and pointing it to the file). Then (there must be a gui element for that, but I don't know it) you type :vert diffsplit ftp://host/relative/path/to/file.fil and can then compare the contents. (If you skip the vert you get a horizontal split)

It does not compare or show file sizes directly (I know it can be shown, I just don't know how as I don't need this)

The comparison looks like this: gvimdiff

For the job of finding differences you can use Filezilla, which has support to locate directories that differ. (Note that I haven't used Filezilla since a long time ago. I recommend it from experience then and will describe this feature from their documentation site, I haven't used it myself as I'm on linux and use unix tools on the shell for such jobs)

To do so open the connection in FileZilla and then Choose View > Directory Comparison. There you can choose the kind of comparison you want (file size or file date. In your case size will be more useful I guess) and then get the differences shown. It can't filter on the files to be compared.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.