Comparing the contents of two files in Sublime Text

LanceLafontaine picture LanceLafontaine · Sep 16, 2014 · Viewed 538.8k times · Source

I have two cloned repositories of two very similar open-source projects, which I have been working on in different instances in Sublime Text 2 to arrive at my desired result. Code from both of these projects was used. I have been using Git as version control for my project, but have not included the original projects. Thus, I would like to be able to quickly compare the contents of two files of the original project and compare the differences between them and my project.

I was hoping that Sublime Text 2 would have a "Compare File" feature, but I can't seem to find anything related to it in the settings or online. A third-party ST2 package to accomplish this task would also work well. Is such a task possible to do within the ST2 text editor?

Answer

Derek 朕會功夫 picture Derek 朕會功夫 · May 3, 2015

You can actually compare files natively right in Sublime Text.

  1. Navigate to the folder containing them through Open Folder... or in a project
  2. Select the two files (ie, by holding Ctrl on Windows or on macOS) you want to compare in the sidebar
  3. Right click and select the Diff files... option.