Recently I needed to compare two very large code files (1200+ lines) in order to make a few small revisions. At work we use the Tortoise SVN Subversion app for revision control and it makes side-by-side file comparison very easy. However, since I was at home, I had to find another way to do it. I Googled “File Comparison” and got a huge list of different free and non-free apps that I could try. I hate downloading unknown apps especially when I won’t be using them much, because they often come with spy-ware and other garbage. I ended up trying something different and it worked pretty well.
I did my file comparison using Google Docs. I was happy to find another cool way to use Google Docs. Plus this keeps it in the cloud in case I needed to access the file from somewhere else. You can do a simple file comparison using the Revision History tool. Here’s how:
1. Create a new document and paste your old code into it. Save your document:
2. Now delete all the code and paste your new code into the same doc. Save your document again.
3. Go to File >> See Revision History
4. Select the current and the previous versions and click the “Compare Checked” button.
5. Where ever changes have been made, the code from your old file will show up as crossed through and the code from your new file will show up as highlighted.
Now the obvious advantage you have in a real file comparison program like Tortoise is that you can make the changes right in the actual code file. With Google I had to find the changes I was looking for, copy the old content and paste it into the file in the correct place. Not the most efficient, but it got the job done quickly and kept me from having to download who knows how many free programs to find one that worked right.