Comparing the contents of two files in Sublime Text

前端 未结 10 1938
被撕碎了的回忆
被撕碎了的回忆 2021-01-29 17:27

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. Co

10条回答
  •  北恋
    北恋 (楼主)
    2021-01-29 17:51

    UPDATE OCTOBER 2017 I never knew this feature existed in Sublime Text, but the interface appears to have changed slightly from the previous answer - at least on OS X. Here are the detailed steps I followed:

    1. In the Menu Bar click File -> Open...
    2. Navigate to the FOLDER that contains the files to be compared and with the FOLDER selected, click the Open button, this makes the FOLDERS sidebar appear
    3. In the FOLDERS sidebar, click on the first file to be compared
    4. Hold the Ctrl on Windows or ⌘ on OS X, and click the second file
    5. With both files selected, right click on one and select Diff Files...

    This opens a new tab showing the comparison. The first file in red, the second in green.

提交回复
热议问题