SVN User Guide in Linux

Source: Internet
Author: User
Tags svn update

1.1 server configuration instructions
1.1.3 configure users and permissions
1.1.4 import the project to the warehouse
1.2 client operation guide and usage specifications
1.2.1 check out work copies
1.2.2 SVN update updates changes made by others
1.2.2.1 obtain the latest version through SVN update
1.2.2.2 SVN update-r get a specific version
1.2.3 View File status information in SVN St
1.2.4 SVN log view log information
1.2.5 SVN diff View File Modification details
1.2.6 SVN list: displays the file list of the version Library
1.2.8 SVN Add add a directory or file
1.2.9 SVN delete a directory or file
1.2.10 SVN revert cancel local modification
1.2.11 SVN commit submit local changes
1.2.12 file update, conflict handling during submission
1.2.13 tag
1.2.14 clear the cached authentication information and re-enter the user name and password
========================
1.1 server configuration instructions
1.1.1 ubuntu-8.10 SVN Server Installation
Sudo apt-Get install Subversion
1.1.2 create a version Library (repository)
To run the Subversion server, you must first create a version Library (repository), which can be seen as a database for storing data on the server. After the Subversion server is installed, you can directly run
CD path_to_svn_root example:/home/SVN
Svnadmin create -- FS-type = fsfssmartphone
-- FS-type: Specifies the repository type. It can be fsfs or bdb. If no value is specified, the default value "Smartphone" is fsfs.
1.1.3 configure users and permissions
Modify the path_to_svn_repos/CONF/svnserve. conf file and open the following configuration item
---------------------------
# Anon-access = read
Anon-access = none
Auth-access = write
Password-DB = passwd
Authz-DB = authz
Anon-access should be set to none, otherwise there is no log information
Modify the path_to_svn_repos/CONF/passwd file and add the user and password.
----------------------------
[Users]
Wanghui = wanghui
...
1.1.4 import the project to the warehouse
SVN importsmartphone/SVN: // 192.168.2.148/Smartphone
1.1.5 run the svn Server
Svnserve-D-rpath_to_svn_root example:/home/SVN
1.2 client operation guide and usage specifications
Take the android source code on our server as an example to introduce common SVN operations.
1.2.1 check out work copies
Copy the checking work ~ /SVN/cupcake-jiangping
Use SVN Co URL
Cd ~ /SVN
SVN Co SVN: // 192.168.2.148/smartphone/td0901/trunk/cupcake-jianpingcupcake-Jianping
1.2.2 SVN update updates changes made by others
1.2.2.1 obtain the latest version through SVN update
SVN update cupcake-jiangping
Or go to the directory Update page.
CD cupcake-jiangping
SVN update
If the application in charge is not highly correlated with the system, we do not recommend frequent updates.
1.2.2.2 SVN update-r get a specific version
Run SVN update in a directory to get the latest version of all files in the current directory. If you only need to get a specific version of a file or directory, you can specify it by-R and name:
SVN update-r 5cupcake-jianping/packages/apps/phone/src/COM/Android/phone/xxxx. Java
1.2.3 View File status information in SVN St
Mcupcake-Jianping/packages/apps/phone/src/COM/Android/phone/xxxx. Java
? Cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/YYYY. Java
M indicates that the file has been modified.
? Indicates that the file is not under version control.
1.2.4 SVN log view log information
SVN log-R: view log information of All Versions
SVN log-R 5: view the log information of a specific version
SVN log-r view the log information of a series of versions in a certain range
If you want to view log details, you can add the-V option, for example:
SVN log-v-R 5
1.2.5 SVN diff View File Modification details
Displays the modification details of a single file or all files in a directory.
SVN diff has three different usage methods
1. Check local modifications
2. Compare the working copy and version Library
3. Compare the version library and version Library
When you do not use any parameter call, SVN diff will compare your working file with the "original" Copy cached in. SVN, for example:
SVN diff cupcake-Jianping/packages/apps/phone
SVN diff cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/zzzz. Java
If you pass a-revision-R parameter, your work copy will be compared with the specified version.
SVN diff-R 3 cupcake-Jianping/packages/apps/phone
If two versions separated by colons are passed through -- Revision-R, the two versions are compared.
SVN diff-R 2: 3 cupcake-Jianping/packages/apps/phone
If you do not have a working copy on the local machine, you can compare the version of the version library. You only need to enter the appropriate URL in the command line:
SVN diff-r 33 SVN: // 192.168.2.148/smartphone/td0901/trunk/cupcake-Jianping/packages/apps/phone
1.2.6 SVN list: displays the file list of the version Library
SVN list SVN: // 192.168.2.148/smartphone/td0901
Design/
Hedoc/
PM/
Release/
Tag/
Trunk/
SVN list SVN: // 192.168.2.148/smartphone/td0901/trunk
3src/
Boot-a1/
Cupcake-Jianping/
Linux-2.6.28-a1/
SVN list is similar to the local LS command. It displays the directory structure of the server.
1.2.7 SVN info view version Library Information
Cd ~ /SVN/cupcake-Jianping
SVN Infos
Path :.
URL: SVN: // 192.168.2.148/smartphone/td0901/trunk/cupcake-Jianping
Version Database Root: SVN: // 192.168.2.148/Smartphone
UUID: 1fac82c5-1665-442c-a8d6-2b3dd850438a
Version: 146
Node Type: Directory
Scheduling: normal
Last modified by tangligang
Last modified: 145
Last modification time: 15:40:50 + 0800 (5)
1.2.8 SVN Add add a directory or file
SVN add cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/xxxx
SVN add cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/YYYY. Java
1.2.9 SVN delete a directory or file
SVN Delete cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/xxxx
SVN Delete cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/YYYY. Java
Be very careful when performing the delete operation. Suppose we want to add an object:
Cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/YYYY. Java
However, we found that this file is not required before submission. At this time, we often use SVN Delete to undo the previously added file:
SVN Delete cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/YYYY. Java
The consequence of this operation is that the local file YYYY. Java is often deleted by mistake, so the correct method is:
Svnn Delete cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/YYYY. Java-keep-Local
1.2.10 SVN revert cancel local modification
1. You can use this command when you find that all modifications to a file are incorrect. Maybe you should not modify the file at all, or re-Modify it from the beginning.
2. You have added a project through SVN Add. You can use this command to cancel the project.
1.2.11 SVN commit submit local changes
Generally, you can submit only the modules you are responsible for. If you are responsible for the telephone module, submit the following command:
SVN commit cupcake-jiangping/packages/apps/phone
Before submission, we recommend that you use the following command:
SVN st cupcake-jiangping/packages/apps/phone view status
M cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/xxxx. Java
? Cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/YYYY. Java
M indicates that the file has been modified.
? Indicates that the file is not under version control.
1. If there is "?" Yes, and the file or directory is added by yourself and is part of the project, you must first execute the svn add operation before submitting: SVN add cupcake-Jianping/packages/apps/phone/src/COM/Android/phone/YYYY. java;

2. conflict must be resolved before submission; otherwise, the submission will fail.
3. log must be written before submission.
1.2.12 file update, conflict handling during submission
$ SVN update
Uxxxx
Gyyyy
Cxxxx. c
1. If the previous status is: C, the conflict exists.
2. modifications have been made in the work copy, and other modifications have been submitted to the server version library after the work copy version is modified. SVN commit will first fail and require update, in this case, a version conflict occurs.
When an update conflict occurs, subversion will generate three files.
Filename. Mine: the file before your update. There is no conflict sign, but the content you have changed recently.
Filename. roldrev: the version that you did not change after the last update.
Filename. rnewrev: the version that the client has just received from the server. This file corresponds to the head version of the version library.
The conflicting file content will be marked by ">>>" in the conflict, and you can choose to merge the file content by yourself.
After the conflict is resolved, SVN resolved path_to_name and subversion Delete conflicts generate three files to be deleted before you can submit them. (You can also manually delete these three files .)
1.2.13 tag
SVN labels are completed through the Copy command, but the operation path must be the server path. labeling is similar to creating a link to a specific version, for example:
Svn cp svn: // 192.168.2.148/smartphone/td0901/trunk/cupcake-Jianping/
SVN: // 192.168.2.148/smartphone/td0901/tags/cupcake-1.0.6
If the current version of SVN: // 192.168.2.148/smartphone/td0901/trunk/cupcake-Jianping is 5 ,/
So SVN: // 192.168.2.148/smartphone/td0901/tags/cupcake-1.0.6 actual/
Is a tag of SVN: // 192.168.2.148/smartphone/td0901/trunk/cupcake-Jianping version 5.

Related Article

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.