A. What is SVN
Full name SubVersion
Code management tools, used in team development, for easy code management
CVS (CVS is the Code management tool prior to SVN) for the development team when the subversion was first developed
After SubVersion1.0, he used subversion to manage subversion.
C/S Program
Server servers are used to manage code (code or project is stored in the server's Warehouse repository)
Clients can submit to the server, download the latest code from the server (check out checkout), commit after modification (commit)
Check out (Checkout)
Submit (Commit)
Client and server interaction via SVN private Protocol
svn://
Whenever the version library accepts a commit, the file system enters a new state, called
One revision (revision), each revised version is given a natural number without a second,
One larger than the original revision number is 0, only created an empty directory, there is no content.
Global Revision Number: Unlike other version control systems, SVN's revision number is for the entire SVN directory tree
, not for a particular file. There's a big difference from CVS.
CVS: Each file has 1.0 1.1 1.2
SVN: Only one file on the global change revision number
Two. Download and install
1. Download svn-1.4.4
Official website http://subversion.tigris.org/
2. Install svn-1.4.4
(1) SVN needs to find Apache server so first install Apache_2.0.63-win32-x86-openssl-0.9.7m.msi
All the way to the next
Note: The Apache web directory is under Htdocs
(2) Installation Svn-1.4.4-setup.exe
All the way to the next
3. Prepare for work and verify that the installation is successful
Place the bin path under Path
Enter SVN validation under CMD to verify that the installation is complete
Use "SVN help" to get usage
Yes, it's installed.
Common commands
Svnserve.exe SVN server
Svnadmin.exe Management
Svn.exe Client
Three. Warehouse creation and import project, etc.
1. Create the warehouse on the server side and start the SVN server
C:\ Set up SVN folder
Create repository folder under SVN folder
(1) Create a warehouse on the server side
Svnadmin Create c:\svn\repository the Repository folder as a warehouse
No prompts to indicate successful creation
(2) Start the SVN server (the server can listen for client requests)
On the command line, enter the following command:
Svnserve-d-R c:\svn\repository start the SVN service
Have SVN use this directory as a warehouse and listen for client requests.
-D for Background mode
-r Specifies the server's warehouse path
D Daemon Background process
R Repository Warehouse
Note: Do not turn off the console when the SVN server is stopped (you can see if the server is turned off by looking at the Svnserve process)
2. Import project from client to server side
Create C:\svnclient\project1 Folder
Take Project1 as a project
Project1 inside the building
Test directory
Test.txt (Analog code *.java)
Import the project into the server (warehouse) and use the client command svn, such as SVN import svn://localhost
Demo Code:
CD svnclient into the path of the project
SVN import svn://loclahost The items under the Svnclient folder to the SVN server, localhost the IP address of the SVN server
Issue 1: A series of warnings (not successful)
SVN:E205007: Unable to get log information using external editor ...
svn:e205007: No Settings svn_editor
Reason: SVN to specify the log variable svn_editor to save the log
So we need to create a new environment variable Svn_editor
Variable name: svn_editor
Value: Notepad
New to start cmd before it becomes effective
New input
CD c:\svnclient
SVN import Svn://localhost
* A notepad appears
– This trip and the following will be ignored –
A
A means add
Shut that Notepad.
Console appears
Log information not modified, or unspecified
a> Terminate,c> continue,e> edit:
Choose c to continue
Question 2:
SVN:E170001: Authentication failed
Reason: We do not specify a good user's username, password, svn to ensure
Users with permissions can submit items, check out items, and not allow anyone
Submit, check out project
********* Set permissions ***********
C:\svn\repository\conf
Svnserve.conf Open this file.
Anonymous access, no user name is required for reading anon-access = Read
Authorized access, have permission to write auth-access = writes anon-access = Read's # Remove so you can read it anonymously.
But now the client can only read anonymously, our import operation is write operation,
So we add a line anon-access = Write
Eventually
Anon-access = Read
anon-access = Write
Stop the server reboot after the modification (the configuration information will be read back at startup)
To import the client's project to the server again
SVN import Svn://localhost
Close the Bouncing Notepad
Log information not modified, or unspecified
a> Terminate c> Continue e> tag
Select C, and the following prompts appear
Increase Project1
Add Project1\test
Add Project1\test.txt
After the submission, the version is 1
3. Create a virtual path on the server side
The imported items are placed in a default directory on the SVN server, and if you import another item by default
This directory is messy, so to create a virtual path on the server side, later on the client import
Project, you can import the project to the specified virtual path
How to create a virtual path
SVN mkdir Svn://localhost/zzy
Virtual paths don't look.
To a single file in Db\revprops Db\revs.
Not like CVS (SVN is putting the whole project in a file)
and import Another project
New Svnclient2 folder Create Project2 project under this folder
CD C:\svnclient2
SVN import Svn://localhost/zzy
Import project each time a text file appears very troublesome how to solve (can not do this exercise)
First remove the SVN_EDITOR environment variable
Set up Log.txt under the C disk
SVN commit hello.txt-f C:/log.txt
This will not be closed every time you enter the command pop-up text file
Four. Use checkout to check out the project
Checkout the project to the specified directory Svnclient3
CD C:\svnclient3
SVN checkout Svn://localhost/zzy
* Remove the specified version
First look at helping SVN help checkout
SVN checkout-r 4 svn://localhost/zzy Check out version 4
Five. Client changes the project to the server after the new submission
After modifying the Test.txt file in the project
CD C:\svnclient3\zzy\project2\test
SVN commit Test.txt
Prompt for lock if commit
You can use SVN cleanup to clear the lock before submitting it.
You can check out the newly submitted project2 in another Svnclient4 folder to see if the submission was successful
Six. Updating update
Download the latest files from the server (not the first download)
First download called Check out checkout
For example, client 4 updates the file Test.txt and submits it to the server
Client 3 can be updated with the following command
CD c:\svnclient3\zzy\ project name
SVN update test.txt
Update calculation read operation
Seven. Retrieve the source of JBoss
http://anonsvn.jboss.org/repos/jbossas/
1.c Disk New JBoss folder
2.
CD JBoss
SVN checkout http://anonsvn.jboss.org/repos/jbossas/
Eight. SVN advanced Operation Rights Management
Username and password in the three files under svn\repository\conf
Svnserve.conf
Authr
passwd
Annotate both lines in the svnserve.conf anon-access = Read anon-access = Write
1. Open this line of comments in the svnserve.conf file
Password-db = passwd
2. Specify user name and password in passwd
Zhangsan = 123
Lisi = 456
Note: After one login, SVN will save our login information in a file on our hard drive.
Its location is: C:\Documents and settings[your login system user name]\
Application Data\subversion, if you want to delete this information, just
Auth folder can be deleted.
If you delete the Auth, next time you have to enter the user name, password
3. The client can modify the Test.txt and then make a new commit. You need to enter a username and password
the use of ****tortoisesvn *******
A. What is TortoiseSVN
TORTOISESVN (Graphical SVN client)
The meaning of Tortoise turtle
TortoiseSVN-1.6
This client can indicate which file is new, changed, and so on.
Right-clicking on a directory will give you two more options
SVN Checkout
TortoiseSVN
Indicates that it has been integrated with the resource manager
Two. Use of TORTOISESVN
(i) Server-side
Create a warehouse and start
(ii) client
1. Create a new project import
Client New C:\myclient Folder
Set up in the inside
Test.txt
Test2.txt
Can be in the project right key (also can enter the project in the blank after the right key)-Select Tortoisesvn–import
URL of repository:
MIDDLEBK is the virtual path name
Enter your username and password
2. Check out the project from the server
New Myclient2 folder Right-click-svn Checkout in Myclient2 folder
Checkout Depth
Fully recursive (full recursive directory and subdirectories are exported) No need to change
The check indicates that the project has been associated with the server
3. Modify the document and submit
The modified file will turn into a red exclamation point! Right--svn commit and turn green
4. New file Test3.txt add to Project
Tortoisesvn-add
The newly added items are indicated by the + symbol icon
After the increase, you have to submit a time before you can oh.
5. Do not want anonymous users to read files on the server anon-access = None
6. Delete Files
Delete a file (for example, Test3.txt) in the client and then right-click in the margin-submit
The file is not in the server either.
Resolve TORTOISESVN does not show green icon problem
*****SVN Integration apache********
After consolidation, use the browser to access the warehouse
Install Apache Server
After consolidation, Apache Rights Management is better than the SVN server itself, finer granularity
Apache doesn't mean Apache Tomcat.
Apache is an application server (Sohu, Sina are the use of Apache)
http://www.apache.org/
Pull below to find the HTTP server hyperlink click the link
Download!
From a mirror click the hyperlink
Select apache2.0
Complete list of Mirrors
Archive download site archive download sites
Binaries-win32
Download Apache 2.0.63-win32-x86-openssl-0.9.7m.msi
Install Apache Http Server
Admin.com
Admin.com
Admin@admin.com
Select the first
For all Users,on Port 80,as a service–recommended.
After installing the Apache server to start the Apache service in Service Manager
Right-click Desktop Apache icon –open Apache Monitor
After start, listen for port 80 on this machine.
client browser Input http://localhost/
Appear:
This is not the page you want to see, right?
Apache Installation Successful
Apache can integrate a variety of functions, how to integrate features?
Answer: integrated in modular form
Integrate features in Apache's following directory
C:\Program Files\apache Group\apache2\modules
SVN and Apache server integration
1. Copy SVN's two so files to Apache's modules directory
The path to SVN's so file is C:\Program files (x86) \subversion\bin
Mod_dav_svn.so
Mod_authz_svn.so
These two files are the necessary files for SVN and Apache consolidation
But it won't be automatically identified by Apache.
Also need to configure the Apache inside
Locate the%apache installation path%\conf\httpd.conf
Find 145 1462 lines (apache2.2 in 83, 84 lines) Remove LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module Modules/mod_dav_fs.so
2. Join in line 174 (if you add it automatically after installation)
LoadModule Dav_svn_module modules/mod_dav_svn.so
LoadModule Authz_svn_module modules/mod_authz_svn.so
3.
Join on the last line