SVN environment construction

1. Install Sunversion :

    The installation directory has no spaces and no Chinese. Click OK. After the installation is complete, enter the command on the command line: svn --version  and press Enter. The following directory appears to indicate that the installation is successful. After the installation is successful, the path directory will be automatically created in the computer system variables. .

 

 

2. Create an SVN version control repository:

Create a folder SvnRep in the E drive (other drives are also available), because one SVN can serve multiple projects (such as OA projects, ERP projects, CRM projects), so create corresponding folders OA , ERP , CRM , in the OA file Create a version control library under the folder, other directories are the same.

Enter the E drive, SVNRep , OA directory on the command line, enter: svnadmin create E:\SvnRep\OA  on the command line, and press Enter to generate a file directory in this directory:

conf: holds configuration files for version control

db: save the database

Hooks: Save the hook program, similar to the trigger function, for example, each time the module is submitted to SVN , an email can be sent at the same time

Lock: file lock

 

3. Start SVN :

Enter in the OA directory     on the command line : svnserve -d -r  E:\SvnRep\OA  Enter, the command line is stuck, but the command line cannot be closed, because SVN starts and works under this command.

    Restart a command line, enter: netstat -an  and press Enter to check whether port 3690 is being monitored . If the port is being monitored, it means that SVN is successfully started, and the client can send a request to SVN :

 

 

4. Register the windows service:

If you use the SVN service, you must enable the command line, which is very inconvenient. Therefore, you can register SVN as a WIndows service, and let SVN start when Windows starts.

Start a command line and enter:

sc create SVNService binpath= "E:\ProgramFiles\Subversion\bin\svnserve.exe --service -r E:\SvnRep" start= auto depend= Tcpip

Note: There is no space to the left of the equal sign, and there is a space to the right of the equal sign

      binpath is the directory of svnserve.exe in the SVN installation directory

      E:\SvnRep is the directory of the SVN version control repository.

After the registration is successful, it will display as shown in the figure:

Enter the Windows Service Manager, start the SVNService service and set it to auto-start at boot. Close other command lines and re-enter on the command line: netstat -an  and press Enter to see if port 3690 is being monitored.

 

5. Test the SVN checkout, commit, and update functions on the client computer (the client computer must have the svn program installed):

Create a folder under any disk of the client computer , such as MyOA , enter the folder on the command line, and then enter:

svn checkout svn:// server IP address /OA press  Enter, and the folder OA is generated in this directory, and the checkout is successful:

And generate hidden file .svn  under MyOA folder .

Test submit function:

Create a text document hello.txt in the checked out OA folder , and use the command to bring the document under svn version control, such as: svn add hello.text press  Enter, the addition is successful. Then enter the conf folder in the OA directory of the server , find the svnserve.conf file, and modify the content of the file as follows:

Enter the commit command: svn commit -m  " commit information "  hello.text  Enter, success:

Test update: Enter another client, check out the OA to modify the hello.txt file, and then submit, after the submission is successful,

Enter in the command line in the initial client: svn update OA  and press Enter. After the update is successful, it is found that the hello.txt file has been modified.

<!--EndFragment-->

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327067627&siteId=291194637