In this tutorial I will show you how to compare files on PhpStorm. This tutorial covers the following options: Comparing Two Files, Compare File with Editor and Compare With.
Code used during this tutorial:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# PhpStorm Comparing files # 1. Comparing Two Files Expand "share/compare" directory Open "file-1.txt", "file-2.txt" and "file-3.txt" Select "file-1.txt" and "file-2.txt" (Ctrl+Click for one file or Shift+Click for a range of files) Right Click / Compare Files Select "file-2.txt" and "file-3.txt" Right Click / Compare Files PhpStorm slightly marks the differences: extra values, different values Only 2 files can be compared Try to select 3 files and you will see that the compare option doesn't appear Compare files "file-2.txt" and "file-3.txt" Use chevron buttons >> and << to replace the content from one panel to another (see tooltip "Replace") Compare files "file-2.txt" and "file-3.txt" Press and hold Ctrl key. >> and << become _| and |_ (see tooltip "Insert") Compare files "file-2.txt" and "file-3.txt" Press and hold Shift key. >> and << become x (see tooltip "Revert") # 2. Compare File with Editor Open "file-1.txt" Click on "file-3.txt" / Right Click / Compare File with Editor # 3. Compare With Click on "file-1.txt" / Right Click / Compare With... Choose "file-2.txt" # Useful links https://github.com/liviubalan/liviubalan.com-vagrant-ubuntu https://www.jetbrains.com/help/phpstorm/2016.1/comparing-files.html?origin=old_help https://www.jetbrains.com/help/phpstorm/2016.1/differences-viewer-for-files.html |
Useful links:
https://github.com/liviubalan/liviubalan.com-vagrant-ubuntu
https://www.jetbrains.com/help/phpstorm/2016.1/comparing-files.html?origin=old_help
https://www.jetbrains.com/help/phpstorm/2016.1/differences-viewer-for-files.html