Installation:
1. install SVN apt-get install subversion to complete SVN installation
2. Create a directory/var/www/demo/and run the CD/var/www/demo/command on cd to reach the directory.
Command: svn checkout svn: // www.oksvn.com/demo
Of course, some of them use http, the command is: svn checkout http://www.oksvn.com/demo
Common commands:
1. Download to the local directory through SVN
Svn chekout (co) svn: // www.oksvn.com/initApp
2. Add a new file www.111cn.net to the version Library.
Svn add file (file is the file name)
[Html] view plaincopy
Svn add test. php
Svn add *. php (add all php files in the current directory)
3. Update files to the version Library
Svn commit-m "LogMessage" [-N] [-- no-unlock] PATH (if you choose to keep the lock, use the-no-unlock switch)
For example, svn commit-m "describes the content" test. php ".
Abbreviation: svn ci
4. Lock/unlock
Svn lock-m "LockMessage" [-- force] PATH
For example, svn lock-m "lock test file" test. php
Svn unlock PATH
5. Restore to a specific version
Svn update-r m path
For example:
If there is no directory after svn update, all files in the current directory and sub-directories are updated to the latest version by default.
Svn update-r 200 test. php (restore the file test. php in the version library to version 200)
Svn update test. php (updated for version Library synchronization. If an expiration prompt is prompted during submission, it is because of a conflict. You need to update the file, modify the file, clear svn resolved, and then submit commit)
Abbreviation: svn up
6. Delete an object
Svn delete path-m "delete test fle"
For example: svn delete svn: // xxx.com/test.php-m "delete test file"
Or directly delete svn test. php and then svn ci-m 'delete test file'. We recommend that you use this
Abbreviation: svn (del, remove, rm)
7. Differences: www.111cn.net
Svn diff path (compare the modified file with the basic version)
Example: svn diff test. php
Svn diff-r m: n path (differences between version m and version n)
Example: svn diff-r 200:201 test. php
Abbreviation: svn di
8. Merge the differences between the two versions into the current file.
Svn merge-r 100:105 test. php (merge the differences between version 100 and version 105 to the current file, but there are usually conflicts. You need to handle them)
9. View Logs
Svn log test. php displays all the changes to this file and their version numbers.
10. View file details
Svn info test. php
11. View the directory/file status
<1> svn status path (the state of the files and subdirectories in the directory. The normal state is not displayed)
【? : Not under svn control; M: The content is modified; C: A conflict occurs; A: It is scheduled to be added to the version Library; K: It is locked]
<2> svn status-v path (displays the status of files and subdirectories)
The first column remains the same, the second column displays the working version number, and the third and fourth columns show the last modified version number and modifier.
Note: svn status, svn diff, and svn revert commands can be executed without a network, because svn is locally deployed. svn retains the original copy of the local version.