Linux SVN server Setup, client operation, backup and recovery

Source: Internet
Author: User
Tags diff svn svn client svn update version control system

Subversion (SVN) is an open source version control system that manages data that changes over time. This data is placed in a central repository, which is much like an ordinary file server that remembers every change in the file so that it can be restored to the old version, or the history of the changes to the file. This document directory: Linux SVN server deployment Linux SVN client command operation Linux SVN backup and recovery one, Linux SVN server deployment1, install SVN [[email protected]~]#Yum Install-y Subversion [[email protected]~] #svnserve--version Svnserve,version1.6. One(r934486)2, create SVN repository [[email protected]~]#mkdir/data/SVN [[email protected]~]# Svnadmin create/data/svn/project [[Email protected]]#ls/data/svn/project/conf db format hooks locks README.txt3, configure SVN [[email protected]]# CD/data/svn/project/conf/[[Email protected]]#lsAuthzpasswdsvnserve.conf File Description:1) under the SVNSERVE.CONF:SVN service configuration file. 2)passwd: User name password file. 3) authz:svn the permissions configuration file. svnserve.conf File The file configuration entry is divided into the following 5 items: Anon-Access : Controls the permissions of non-authenticated users to access the repository. Auth-Access : Controls the permissions for the authentication user to access the repository. Password-DB: Specifies the user name password file name. Authz-DB: Specifies the permission profile file name through which path-based access control can be implemented. Realm: Specifies the authentication domain for the repository, which is the name of the authentication domain that is prompted at logon. If the authentication domain of the two repositories is the same, it is recommended to use the same username password data file configuration as follows: [Email protected]]#grep-E"anon-access =|auth-access =|password-db =|authz-db =|realm="svnserve.conf Anon-access =None Auth-access =WritePassword-db =passwdAuthz-db =Authz Realm=/data/svn/the project passwd file is configured with a user name and password [email protected]]#Cat passwd[Users] Yangyun=yangyunpasswd Test=testpasswd Authz File Configure user access [[email protected]]#CatAuthz |grep-V'#'[aliases] [groups] Project_w=Yangyun Project_r=Test [/] Project_w=RW Project_r=R4, start the SVN service [[Email protected]]# svnserve-d-r/data/SVN5, initialize SVN data [[Email protected]]# svn import MySitefile:///data/svn/project/-M ' initial import 'will copy the directory MySite to the repository under Project [[Email protected]]# svn listfile:///Data/svn/projectmanage.py MySite/Static/Templates/WEB02/after the import, the original directory tree did not convert to a working copy, in order to get started, or to run SVN checkout to export a working copy. Second, Linux SVN client command operation1, checkout files to the local directory svn checkout path (path is a directory on the server) shorthand: SVN Co: SVN Co svn://115.28.24.178/project--username=yangyun--password=yangyunpasswd#指定版本的文件 SVN Co svn://115.28.24.178/project--username=yangyun--password=yangyunpasswd-r 5 2, add new files to the local repository svn addfile#此命令得在checkout出来的路径里才能操作 For example:CP/root/123. txt./SVN add123. txt #把123. txt added to the local library A123. txt3, commit the changed file to the Repository svn commit-M"LogMessage"[-N] [--no-unlock] PATH (if lock is selected, use--no-unlock switch) shorthand: SVN ci example: SVN commit123. txt-m'Add 123.txt'#只提交123. txt commit-M'Add 123.txt'#默认提交当前目录下的所以文件 SVN commit*.txt-m'Add 123.txt'#也可以正则匹配文件提交4LockingUnlock svn lock-M"Lockmessage"[--Force ] PATH Example: SVN lock-M"Lock test File"test.php svn unlock PATH5, update to a version of SVN update-r m path for example: SVN update if there is no directory behind it, the default is to update all files in the current directory and subdirectories to the latest version. SVN update-R $test.php (Restore the files in the repository test.php to the version of the SVN update test.php (updated, in the Repository sync.) If the prompt expires at the time of submission, it is because of the conflict, you need to update, modify the file, then clear the SVN resolved, and then commit the commit shorthand: SVN up6, delete file svn delete path-M"Delete Test fle"For example: SVN delete svn://192.168.1.1/pro/domain/test.php-m "Delete testfile"or just svn delete test.php and then svn ci-M'Delete Testfile ', it is recommended to use thisshorthand: SVN (del, remove,RM)  7, view Log svn log path for example: SVN log test.php shows all the changes to this file and its version number8, view file Details svn InfoPath for example: SVNInfotest.php #可知道路径版本, time, submitter and other information9, compare differences svndiffpath (compares the modified file to the underlying version) For example: SVNdifftest.php SVNdiff-r m:n Path (difference between version m and version N) For example: SVNdiff-R $:201test.php #可知道修改了哪些内容 shorthand: svn diTen, merge the differences between the two versions into the current file svn merge-r m:n Path Example: SVN merge-R $:205test.php (The difference between version 200 and 205 is merged into the current file, but there is a general conflict that needs to be addressed) One, SVN helps svn help SVN A, repository list of files and directories svn list path #显示path目录下的所有属于版本库的文件和目录 shorthand: SVNls   -, create a new directory under version control SVNmkdir: Create a new directory under the included version control. Usage: SVN mkdirpath #效果等同:mkdirtest;svn Add test;  -, revert locally modified SVN revert: Restores the original unchanged working copy file (restores most of the local modifications). revert: Usage: revert PATH ... Note: The notebook command will not access the network and will release the conflicting condition. But it won't recover the deleted directory Iii. Linux svn backup and recovery1, full-scale backup: Curr= ' Svnlook youngest/data/svn/project/' #此处是查询工程目录的最新版本 svnadmin dump/data/svn/repos/test--revision0: $cur--incremental >0-"$curr"Svn.bakEcho$curr >/tmp/svn_revision2, incremental backup old=`Cat/tmp/svn_revision ' New= ' Svnlook youngest/data/svn/project/' Svnadmin dump/data/svn/repos/test--revision $old: $new--incremental > $old"-"$new"Svn.bak 3, the SVN recovery recovery sequence recovers from the lower version to the higher version one at a time, that is, restore the last full backup first, and then restore the incremental backup next to the file. CD/data/svn/repos/svnadmin Create test2 svnadmin load Test2</data/svnback/20110719/0-1112svn.bak svnadmin Load test2</data/svnback/20110719/1113-1120svn.bak

Linux SVN server Setup, client operation, backup and recovery

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.