Refers to How to create patch file using patch and diff, you can actually read the diff file to compare the difference between the files. But what if you wanna compare and edit simultaneously?
Given 2 different files at your hand, you can do that with vimdiff. Let say I wanna compare this two files Tb01/TbApi.cpp and Tb02/TbApi.cpp, I can do this
vimdiff Tb01/TbApi.cpp Tb02/TbApi.cpp
It nicely put two codes in a split windows, one at left and another at right. And it shows clearly the differences of them with highlights and line spacing. You really have to try it yourself to see how efficient it is.
By shifting from one windows to another, by pressing ctrl + w and press right arrow to move from left to right.
After finish editing,
To close both files and simultaneously write the changes, or
which close both files without save.