Sometimes, we have this requirement, that is, we want to compare the differences between two different versions of code . How to achieve it?
Type 1 : If we are a project that is detected from SVN and want to compare the differences between the local code and the code that is detected from SVN, we can follow the steps below.
As shown in the above figure, in the code editing area,右键to call out the function menu and select Subversion , which will show more options, such as:
Compare with the Same Repository Version , which compares the same version as the SVN repository;Compare with Latest Repository Version , compares with the latest version of the SVN repository;Compare with... , click to select different versions of this branch for comparison; Compare with Branch , after clicking, you need to configure the specific branch to be compared first, and then compare with the specified branch;Show History , similar Compare with... , is just to show the version history of this branch first.Through the above method, we can already meet our needs for comparing online branch codes!
Type 2 : Comparing the differences between two local codes, you can follow the steps below.
First, select the target folder (select the src folder in the figure),右键to call out the function menu, and then click Compare With :
As shown in the above figure, select another local code to compare with the same directory, and then click the Open or打开and确定button:
As shown in the above figure, the difference between the two codes is clearly shown.
Summarize
The above is the method of using IntelliJ IDEA to compare codes introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support to Wulin.com website!