SVN version control system Quick Reference
I. SVN download and Installation
SVN is a centralized version control system. You need to use the server storage Version System for team collaboration.
Subversion
Http://subversion.apache.org/
You can also use visual SVN on Windows,
Http://www.visualsvn.com/server/download/
Graphic Interface tortoisesvn
Http://tortoisesvn.net/
Eclipse support plug-ins
Http://subclipse.tigris.org/
Installation (Windows)
Install SVN on a Windows platform and directly execute the Installation File Setup-Subversion-1.8.10.msi.
Run svn to check whether the installation is successful.
Then install tortoisesvn and execute the Installation File TortoiseSVN-1.8.8.25755-x64-svn-1.8.10.msi directly
After installation, you can use the command line to operate the version library or the TortoiseSVN graphical interface to operate the version library.
Ii. server operations
1. Create a version Library
$ Svnadmin create svnrepo
The Directory of D: \ svnrepo will be created and the folder will be initialized. The files in the directory are version library files.
2. Modify the permission Configuration
Modify the configuration file svnserve. conf of the version library and open password-db = passwd.
Svnrepo \ conf \ svnserve. conf
# Password-db = passwd
Modify the configuration file passwd and add the user and password
Svnrepo \ conf \ passwd
[Users]
Gym = ******
3. Running Server
Start svn Service
$ Svnserve-d-r d: \ svnrepo
After running the server, you can access the server version library through the following URL:
Svn: // localhost
In explorer, right-click the pop-up menu and start tortoisesvn graphical interface tool to view the server version library TortoiseSVN/Repo-Browser.
3. client operations
1. Check out (checkout)
Check out a working copy from the version Library
$ Svn checkout svn: // localhost d: \ testsvn -- username = gym -- password = ******
$ Cd testsvn
$ Svn info
2. add files to version library management (add)
Add a new project file
$ Svn mkdir project1
A project1
$ Svn status
A project1
Follow the conventions to create three directories, trunk, branches, and tags, which are trunk, branch, and tag.
$ Cd project1
$ Svn mkdir trunk
$ Svn mkdir branches
$ Svn mkdir tags
Create the test1.txt file under trunk.
$ Cd trunk
$ Svn add .\*
3. Submit changes (commit)
Submit changes to the version library.
$ Svn commit-m "add project project1" -- username = gym -- password = ******
View logs
$ Svn log
4. update)
Merge changes to the version library into the work copy.
$ Svn update
View differences
$ Svn diff
5. Restore (revert)
If you want to cancel the modification before submitting the ticket, it will be restored to the last submitted status.
Restore a single file
$ Svn revert test1.txt
Restore the entire branch
$ Svn revert-R trunk
6. Branch Management (copy, merge)
Create Branch
$ Cd testsvn \ project1
$ Svn copy trunk branches \ mybranch
$ Svn commit-m "add branches"
Create the file test2.txt under branches \ mybranch.
$ Svn add branches \ mybranch \ test2.txt
$ Svn commit-m "add test2.txt"
Merge Branch
$ Cd trunk
$ Svn update
$ Svn merge-r 27: HEAD .. \ branches \ mybranch
Post-conflict notification
If there is a conflict during update or merge, the SVN will be notified after the conflict is resolved.
$ Svn resolve -- accept = working text1.txt
7. tag)
Create tags for milestone changes or version releases.
$ Svn copy -- revision = 28 trunk \ tags \ project_1.0
$ Svn commit-m "create tag project_1.0"
4. Use SVN in eclipse
Install the SVN support plug-in Subclipse in eclipse.
Click eclipse menu: Help/Install New Software...
Enter the URL to automatically download the plug-in.
URL: http://subclipse.tigris.org/update_1.10.x
Click addto use the downloaded subclipseplug-In site-1.10.5.zip
Use SVN:
In the eclipse Project, right-click the Team/Share Project in the pop-up menu...
-------------------------------------- Split line --------------------------------------
Subversion configuration instances in Linux
CentOS 6.2 SVN setup (YUM installation)
Deploy Apache + SVN in CentOS 6.5
Build an SVN server using Apache + SVN
Set up and use the SVN server in Windows + reset the password on the client
Install SVN in Ubuntu Server 12.04 and migrate Virtual SVN data
Build svn service and migration method on Ubuntu Server
Build SVN server with online storage
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: