Linux SVN server configuration and client usage

Source: Internet
Author: User

Linux SVN server configuration and client SVN are a version management system. Its predecessor is CVS and is the cornerstone of open source software. Even when the communication is sufficient, the maintenance of the same source code by many people may also lead to confusion. The version management system is designed to solve these problems. Some concepts in SVN:. repository (source code library) where the source code is uniformly stored B. checkout (extract) when you have no source code, you need to copy c from repository checkout. commit (submit) when you have modified the code, you need to Commit to repository d. update: When you have already Checkout the source code, you can synchronize the source code with the source code on Repository after an Update, the code on your hand will have the latest changes to the daily development process of www.2cto.com (assuming you have been Checkout and have been working for a few days): Update (get the latest code) --> make your own modifications and debug them successfully --> Commit (you can see your modifications) What if two programmers modify the same file at the same time? SVN can be changed by the two programmers of Merge. Correct and merged. In fact, SVN manages the source code in units of behavior, that is, if the two programmers do not modify the same program, SVN automatically merges the two changes. If the row is the same, SVN will prompt the file Confict, conflict, You need to manually confirm. TortoiseSVN introduction TortoiseSVN is a free open-source client of the Subversion version control system, which can manage files and directories over time. Files are stored in the central version library. Apart from remembering every modification to files and directories, the version library is very similar to a common file server. You can restore the file to a previous version, and check the history to find out which modifications have been made and who has made the changes. This is why many people regard the Subversion and version control system as a "time machine ". SVN configuration 1. Configure yum and check the subversion installation package [root @ svn ~] # Yum list | grep subversion. i386 1.4.2-4. el5_3.1 base subversion-devel.i386 1.4.2-4. el5_3.1 base subversion-javahl.i386 1.4.2-4. el5_3.1 base subversion-perl.i386 1.4.2-4. el5_3.1 base subversion-ruby.i386 1.4.2-4. el5_3.1 base [root @ svn ~] # Yum-y install subversion to test whether the installation is successful: svnserve -- version press enter to display the version Description: the installation is successful [root @ svn ~] # Netstat-nat check whether the default TCP port 3690 is listened. 2, create the svn version Library [root @ svn/] # mkdir-p/data/svndata [root @ svn/] # svnadmin create/data/svndata/winne for version library name 3, svnserve configuration file overview svnserve. conf -- svn service configuration file, under the conf directory of the file version library directory. Passwd -- user name and password file. The file name is specified in the file svnserve. conf and is in the same directory by default. Authz -- permission configuration file. The file name is also specified in the file svnserve. conf. The default value is in the same directory. The conf/svnserve. conf file configuration items are divided into the following five items: anon-access controls the permissions of non-authenticated users to access the version library. Auth-access controls the permission of the authenticated user to access the version library. Password-db specifies the username and password file name. Authz-db specifies the permission configuration file name, which can be used to implement path-based access control. Realm specifies the authentication domain name of the version library. If the two versions of the database have the same authentication domain, we recommend that you use the same user name and password data file. Note: The bug of the anon-access = read parameter in version 1.4. when anon-access = read is used, the client Checkout (extract) has a Not authorized to open root of edit operation "error. changing it to the none parameter is normal, conf/Passwd file user1 = user1 user2 = user2 conf/authz file [groups] Set Group admin = user1 [/] root directory permission settings (that is, the "svndata" folder) user1 = rw user 1 permission: read/write user2 = r user 2 permission: readable, not writable @ admin = rw set group permission [svndata: /winne] set the permission user1 = rw user2 for the "winne" folder in the root directory = R... Similarly, 4. Start and Stop the SVN service to start the SVN service: [root @ svn ~] # Svnserve-d-r/data/svndata/-d indicates that the backend runs-r specifies that the root directory is/data/svndata/to stop the SVN service: ps-aux | grep svn kill-9 process kill the use of the Windows client TortoiseSVN client 1. The TortoiseSVN Client installation test selects the TortoiseSVN 1.6.5 client to pay the Chinese translation package. 2. Update the client file to the server (user1 operation) to create an empty directory, right-click Checkout (extraction) svn: // 192.168.103.26/winne enter the authorized user account in the passwd file to add some files to the directory for testing. right-click TortoiseSVN-> ADD to ADD the list to the server. at this time, the file is not actually copied to the server. You need to copy the file in the version library browser after the Commit (submit) operation, The submitted version is 1. 3. The client pulls and reads data on the server (user2 operation) User2 creates an empty directory user2 on the machine, right-click Checkout (extraction), and fill in the address: svn: // 192.168.103.26/winne output to G: \ user2 to add a new.txt file. After Commit (submit), the system prompts that the permission error occurs. user2 has no write permission, the request can be submitted successfully only when user1. the procedure for using A client on A Linux client is generally: User A: checkout (extract)-> add (add new file)-> commit (submit) User B: SVN log (view updates) -> update (updated version) 1. install yun-y install subversion 2 in SVN. The short command is used in Common commands () of Linux svn. checkout (co) extract commit (ci) commit upda Te (up) update list (ls) list 3. checkout (co) extracts files from the svn server (user1) operation process [root @ TEST ~] # Svn co svn: // 192.168.103.26/winne Authentication realm: My First Repository Password for 'root': Authentication realm: My First Repository Username: user1/enter the Username Password for 'user1 ': /enter the password A winne/Cosmic Ride-BeFour. lrc A winne/20070716171657126.pdf A winne/svnbook1_revision 1. /checkout (co) is extracted successfully, and the Checked out version is 1. Note: Access with username and password is allowed: svn co -- username user1 -- password user1 svn: // 192.168.10 3.26/winne [root @ TEST ~] # Ll drwxr-xr-x 3 root 4096 Sep 23 winne/winne directory is the drwxr-xr-x 2 root 4096 Jul 30 tasks [root @ TEST ~] # Cd winne [root @ TEST winne] # ll total 2868-rw-r -- 1 root 1566968 Sep 23 20070716171657126.pdf-rw-r -- 1 root 2397 Sep 23 Cosmic Ride-BeFour. lrc-rw-r -- 1 root 1354300 Sep 23 08:53 svnbook1_4, user1 modify the file and submit [root @ TEST winne] # vi testsvn.txt [root @ TEST winne] # svn add testsvn.txt/add testsvn.txt to the database A testsvn.txt [root @ TEST winne] # svn commit-m "test" testsvn.txt/comment to test Adding testsvn.txt Transmitting file data. committed revision 2. /version 5 is updated to 2, user2 is returned to window client, and version update is returned to Windows client to view logs. The version has been updated to 2, comment test, update the client to a new version. 6. For Windows Client Version rollback, select update to verisiom from the selected menu and select version 1. 7. Linux version rollback: [root @ TEST winne] # svn up-r 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.