Rel = "file-list" href = "https://p-blog.9cbs.net/images/p_blog_9cbs_net/forlinux/svn_filelist.xml.gif" /> rel = "edit-time-data" href = "https: //p-blog.9cbs.net/Images/p_blog_9cbs_net/forlinux/svn_editdata.mso.gif "/> Rel =" OLE-Object-data "href =" https://p-blog.9cbs.net/images/ p_blog_9cbs_net / forlinux / svn_oledata.mso.gif "/>
Build a version control environment using Subversion (Windows)
Summary:
In software development, CVS has always been the first choice for version control over a long period of time. But now the user has another may be a better choice of SVN (Subversion). The SVN is the next generation of version control system, which can be replaced by the project under CVS, CVS, or it can be very easy to go to SVN control (SVN project home page is http: //subversion.tigris.org, tiGris itself is some Open source project under SVN control can be said to be a SVN version of SourceForge).
SVN is a free, open source, cross-platform version control system. It is a general system that can manage any type of file, including the program source code.
The design objectives of the SVN are clear, realizing the existing CVS's existing function, fully considering the existing CVS users, imitating CVS in the way, and develops a series of tools, making CVS-based projects to migrate to SVN . As a new generation of version control systems, compared to CVS, it has many advantages, such as directory version control, unseutive submission, consistent data processing mode and more efficient branches and tags.
Now, many open source projects have begun to shift below SVN control. As a software developer, the project developed using the Subversion control is an inevitable trend. This article describes the answer to the SVN environment and the simple usage method of the SVN environment as an example.
One,
Prepare related software
a)
, Subversion Server SVN-WIN32-1.3.2.Zip
It is recommended to download the latest version directly to http://subversion.tigris.org/
b)
, Subversion client TortoisesVN-1.3.5.6804-SVN-1.3.2.MSI
TortoiseSVN is a very nice SVN client that enables close combination with the resource manager. It is recommended to download the latest version to http://tortoisesvn.tigris.org/ (I believe many friends who have used CVS should have used TortoiseCVS.).
c)
, VS.NET uses SVN plug-in Ankhsetup-0.5.3.1636.msi
Ankhsvn is a quite a good VS.NET SVN plugin that can be downloaded to Ankhsvn's official website to download the latest version http://ankhsvn.tigris.org/. For more detailed information about AnkHSVN, please visit http://ankhsvn.tigris.org/screenshots.html.
d)
Apache Web Server (SVN-1.3.2 Recommended APACHE-2.0.54).
You can download the appropriate version to http://www.apache.org/dist/, it is best to match the version used in the Subversion software. If the required Apache version is old, you can download http: // archive to the Apache history version page. .apache.org / dist /. e), TortoisesVN Simplified Chinese Language Pack (LanguagePack-1.3.5.6804-Win32-en_cn.exe), please go to http://tortoisesvn.tigris.org/download.html Select the download corresponding version.
Tips:
After the above software is downloaded, you may wish to put it under the same folder and attach a readme.txt file containing the software brief description to prepare for future use.
two,
Software Installation
a)
, Install Apache
Apache installation is quite simple, it is worth noting that if IIS is already installed, please stop first, you can use the following command:
NET STOP W3SVC
b)
, Install TortoiseSVN & TortoiseSVN Simplified Chinese language pack
There is not a special place for installation, just install TortoiseSVN to install the language package.
c)
, Install the Subversion.
i.
Unzip the downloaded SVN-WIN32-1.3.2.zip to the C: / usr / local / directory. And renamed SVN, that is, usr / local / svn /;
II.
Copy LiBeay32.dll, SSLEAY32.DLL two DLL parts to C: / Winnt / System32 directory;
III.
Copy libapriconv.dll, libdb43.dll, intl3_svn.dll to the apache / bin directory;
IV.
Copy MOD_DAV_SVN.SO, MOD_AUTHZ_SVN.SO two files to apache's modules / directory;
v.
Create a text file MOD_SVN.CONF to enter the following in the cicket / directory
# Loading the corresponding module
LoadModule Dav_svn_module /usr/local/svn/bin/mod_dav_svn.so
LOADMODULE Authz_svn_module /usr/local/svn/bin/mod_authz_svn.so
#LoadModule DAV_SVN_MODULE MODULES / MOD_DAV_SVN.SO
#LoadModule Authz_svn_module modules / mod_authz_svn.so
# Configure the warehouse
DAV SVN
SvnParentPath / usr / local / repository # 库 parent directory is located in C: / usr / local / repository
# Svnpath / usr / local / respository / svn1 # Warehouse Directory
Location>
VI.
If you need to use Apache, you need to do the following adjustments:
Enter the Apache / bin directory, perform the following command to generate a password verification file
htpasswd -cm / usr / local / svn / svn-auth-file user1
Enter the password of the user when you enter your password
If you need to add users User2, do the following command
HTPASSWD -M / USR / local / svn / svn-auth-file user2
Delete a user (User2), you can use the following instructions:
htpasswd -d / usr / local / svn / svn-auth-file user2
Generate password files using htpasswd
VII.
After the verification is enabled, the SVN-related configuration is as follows
DAV SVNSVNPARETPATH / USR / local / repository # warehouse parent catalog located in C: / usr / local / repository
Authtype Basic
Authname "Subversion Repository"
Authorfile / usr / local / svn / svn-auth-file
Require Valid-User
AuthzsvnaccessFile / usr / local / svn / svn-access-file
Location>
Viii.
SVN-Access-file is used in the configuration file, which is used to control the user access SVN warehouse privilege, and below will explain the configuration of the following Access files.
[SVN1: /] // This means that access rights under the root directory of the warehouse SVN1
User1 = rw // svn1 warehouse USER1 user has read and write permissions
User2 = r // svn1 warehouse USER2 users have read rights
[SVN2: /] // Access to the root directory of the SVN2 warehouse
User1 = r // USER1 users only read permissions in the root of the SVN2 warehouse
User2 = // USER2 users do not have any permissions in the root directory of the SVN2 warehouse
# [/] // This means that under the root of all warehouses
# * = r // This means that all users have read rights
# [groups] // This represents group settings
# svn1-wevelopers = USER1, USER2 // This means a member in a group
# svn2-wevelopers = USER1
# [svn1: /]
# @ SVN1-Developers = RW // If you add @ symbols in front, this is a group permissions setting.
IX.
Restart Apache
Note: The DocumentRoot directory is not set to the SVNParentPath value of the SVN, otherwise 301 MOVED Permanently ... error
three,
Software use
a)
, Use the command line (CMD window mode)
Create a new repository
svnadmin create / path / to / repository
Svnadmin is a useful Subversion system management command, using Svnadmin Help View online help
information.
Add new project (Import New Project)
SVN Import Project File: /// repository_name / project -m "comment"
SVN import project http: // YourHost / SVN_DIR / repository_name / project -m "comment"
Checkout project
SVN Checkout File: /// repository_name / Project / TRUNK PROJECT
SVN Checkout http: // Yourhost / SVN_DIR / Repository_name / Project / Trunk Project
List items in the warehouse (list)
SVN List --verbose file: /// repository_name / Project
SVN List --verbose http:// host / svn_dir / repository_name / Project
Status query (STATUS)
SVN Status
Give new files, changed files and deleted file lists; add files or directories (Add)
SVN Add
Delete files or directories (Delete)
SVN Delete
SVN Delete http: // YourHost / SVN_DIR / Repository / Project_Dir
Submit (commit)
SVN commit http: // Yourhost / SVN_DIR / Repository / Project_Dir
Update
SVN Update
Update the files in the warehouse to your local.
Tags and special version items
Use a copy command
Svn Copy http: // YourHost / Repos / Project / Trunk http: //yourhost/repos/project/tags/1.0.0
Snapshot (Snapshot) for creating a particular version;
SVN List http: //yourhost/repos/project/tags/1.0.0
b)
Here we use the commands described above to create a test warehouse
i.
Open the command prompt, enter the E: / repository directory, perform the following command
II.
Restart Apache, browse http: // localhost / repos / qjoa, if you see the following screen, the SVN has been working properly.
III.
The warehouse just established is just an empty repository, there is no item / file inside, below, I will demonstrate how to add a project to the warehouse, using the following command
SVN IMPORT D: / WORKSPACE / OTH_007_QJTECH-OA HTTP: // localhost / repos / qjoa -m "svn init project"
Note: The above command must be entered in a single line, and the Import project is best to remove the Apache verification first, otherwise the Import project will fail!
IV.
OK, re-browse http: // localhost / repos / qjoa Try, if a picture similar to the following figure occurs, the project import is successful;
c)
Introduction to TortoiseSVN operation
i.
Choose a language
After TortoiseSVN is installed, the default is English. In order to use Chinese, you need to do the following, right-click TortoiseSvn-> Settings in Windows Explorer.
The following dialog box is displayed, and "Chinese (Simplified)" is selected, click the application, that is, change the default display as Chinese as shown below:
II.
Add project (import)
Enter the folder that needs to be imported, right-click "TortoiseSVN" -> "Import", you can appear as shown below, fill in the newly created warehouse in the file library path http://www.ilinux.com.cn/ REPOS / QJOA, click OK, you can complete the import of projects.
III.
Checkout
In the Work Contents New Folder Qjoa (I use D: / Workspace / QJOA), when there are multiple projects, use the working directory definitely a good habit ^ _ ^, enter the QJOA directory, right click, that is, As shown in the menu shown below
Click "SVN Remove", the screen as shown below,
Fill in the appropriate information, click OK, TortoiseSVN will start to detect items as shown below.
IV.
List of items
Right-click on the TortoiseSvn-> file library browser in the resource manager;
Fill in the warehouse path in the URL column, you can browse the warehouse content, as shown below.
Status query
VI.
Add files or directories
Select the folder or file you want to add to right-click "TortoiseSVN" -> "Add"
VII.
Delete files or directories
Select the folder or file you want to add to right-click "TortoiseSVN" -> "Delete"
Viii.
Submit a modification
At the working directory, right click -> "SVN Submit"
IX.
Update
At the working directory, right click -> "SVN Update"
Note: Submit is required after adding or deleting. For more detailed usage of Subversion, please consult the Subversion's official document Chinese version.
four,
related resources
a)
, Subversion Chinese Station (http://www.subversion.org.cn/);
b)
, Subversion official station (http://subversion.tigris.org/);
c)
, Subversion official document Chinese version (http://www.easyea.com/doc/ch/svnbook/);
Fives,
reference
a)
Installing Subversion (http://svn.collab.net/repos/svn/trunk/install);
b)
, Cvs to svn crossover guide (http://svn.collab.net/repos/svn/trunk/doc/user/cvs-crossover-guide.html);
c)
, Apache Document 2.0 (http://httpd.apache.org/docs/2.0/);
Download this document electronic version