intellij idea svn uses an import, update, commit, conflict resolution

Basically a reprint, with some special additions for version 14.

Check out the svn repository:


There is an additional svn window below, and there is a plus sign on the left to add an svn library


Enter the svn address, I am using a local test, so the address is svn://127.0.0.1/newproject This address is different depending on the service, it may be http or https


After adding the address of the svn library, we can browse the files on the library, and of course we can do some operations, such as deleting, viewing history, etc. Here, when adding the svn library, if there are permission restrictions, you will be asked to enter the user name and password


Import the project into our workspace, which is called project under idea, and our project is called module
. For IDEA14, import the svn project into the idea workspace as follows:

File->New->Project from Version Control->Subversion, then enter the url and click the name of the project you want to checkout, click checkout to get the following picture:


IDEA14: There is no src code part in the imported project at this time, so you need to import the code. The specific method is as follows:
File->New->Module from Existing Sources, then select the path of the directory where you checkedout above, and then click OK, the code came in.

//check to the workspace and then import to the current window


Just next is fine. Of course, if it is an eclispe project, it should be selected according to the situation.



Ok, now the code has been pulled down


You can view the history of the code, this is the history on the library, see who has changed it, etc.


Information will be displayed in the following window, and now you can see that the code of the library is only submitted once when it is initialized


We first change the code and add a line of code as shown in System.out.println("hahah!");

Change file1 as well, and you can see that these two files have been modified in the changes window below.


Here is a small function. If we have some files and we don't care whether they have changed, we can create a new changelist. I call it new changelist here, and we can put files we don't care about here, so that we can observe what we care about. For example, if it is a large project and we don't care about many class files, we can do this



We start to submit our modified code. The general order is that we update first. If there is no prompt when updating, we can submit it smoothly. If there is a conflict, he will tell us that there are conflicts in those files and need to be resolved. Here I think Not as intuitive as svn in eclipse


 Submitted smoothly


Let's make a conflicting example. I use the code that other users have changed in the same line elsewhere.


So when we update according to the method just now, it will tell us that there is a conflict


Click merge and the following interface will appear. This feels better than eclipse. The middle one is the final result we want, and the two conflicting versions are on both sides. Solve the conflict as needed, click apply means that the middle one is already The result we want in the end. Then submit it


Final Results


 Here are some functions that may be useful to see which files have changed in a certain version


After the left button, there can be some operations, such as comparing with the local and a certain historical version, etc.


You can also restore a certain file to a certain historical version, the head is the latest, you can click on the selected version above
 

Here you can see the local version of the history


Some versions saved locally, sometimes useful here


It is very convenient to see which files have been changed in each version


 There are two windows, very direct








Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326388998&siteId=291194637
Recommended