Reprinted from: http://lee2013.iteye.com/blog/1058047
SVN as an indispensable tool in daily development, SVN installation in Ubuntu is very simple, sudo apt-get install subversion, and then follow the prompts step after year to complete the installation of SVN
1. Checkout files to a local directory
svn Checkout Path (path is a directory on the server) for example: SVN checkout svn: // 192.168.1.1/pro/domain shorthand: SVN co
2. Add a new file to the repository
*. PHP (Add all the PHP files in the current directory)
3. Submit the changed files to the repository
SVN commit-m "LogMessage" [-n] [--no-unlock] PATH (if hold lock is selected, use –no- for my test "test.php shorthand: svn ci
4. Locking/unlock
SVN lock-m "Lockmessage" [---M "Lock test File" TEST.PHPSVN unlock PATH
5. Update to a version
SVN update-R test.php (restore the file test.php in the repository to version 200)
SVN update-r 200 replaces all files in the repository with the 200 replacement SVN update test.php (updated, synchronized in the repository.) If the prompt expires at the time of submission, it is because of the conflict, you need to update, modify the file, then clear the SVN resolved, and then commit the commit) shorthand: svn up
6. View file or directory status
SVN status path (status of files and subdirectories under directory, normal status not shown) "? : Not in SVN control; M: Content modified; C: conflict; A: Scheduled to add to Repository; K: Locked "svn status-v path (show file and subdirectory status) the first column remains the same, the second column shows the work version number, The third and fourth columns show the last modified version number and the modified person. Note: The SVN status, SVN diff, and SVN revert three commands can be executed without a network, because SVN retains the original copy of the local version in. svn. Shorthand: SVN St
7. Delete Files
SVN Delete path-m "Delete test Fle" Example: SVN delete svn://192.168.1.1/pro/domain/test.php-m "Delete Test file " or direct svn delete test.php and then svn ci-m ' Delete test file ', recommended this shorthand: SVN (del, remove, RM)
8. View Logs
SVN log path For example: SVN log test.php shows all the changes to this file and its version number
9. View File Details
SVN info Path Example: SVN info test.php
10. Compare Differences
-R 200:201 test.php shorthand: svn di
11. Merge the differences between the two versions into the current file
SVN Merge-R 200:205 test.php (the difference between version 200 and 205 is merged into the current file, but there is a general conflict that needs to be dealt with)
12. SVN Help
SVN helpsvn help CI
——————————————————————————
The above is a common command, the following write a few common
——————————————————————————
13. List of files and directories under the repository
SVN list path displays all files and directories belonging to the repository in the path directory shorthand: SVN ls
14. Create a new directory under version control
1.mkdir PATH ... 2.mkdir URL ... Create a version-controlled directory. 1. Each directory specified in the working copy PATH will be created on the local side and added to the new schedule for the next commit. 2. Each directory specified in the URL will be created by submitting it to the repository immediately. In both cases, all intermediate directories must exist beforehand.
15. Restore Local Modifications
SVN revert: Restores the original unchanged working copy file (restores most of the local modifications). revert: Usage: revert PATH ... Note: The notebook command will not access the network and will release the conflicting condition. But it does not restore the deleted directory
16. Code base URL Change
Switch
1.switch URL [path]2,switch –relocate from to [path ...] 1. Update your working copy to map to a new URL that behaves like SVN update and merges the file on the server with the local file. This is the method that corresponds a working copy to a branch or tag in the same warehouse. 2, rewrite the working copy of the URL metadata to reflect the simple URL changes. When the repository's root URL changes (such as scheme name or hostname change), but the working copy is still mapped to the same directory as the same repository, use this command to update the corresponding relationship between the working copy and the warehouse.
17. Conflict resolution
SVN resolved: Removes the "conflicting" status of the working Copy's directory or file. Usage: Resolved PATH ... Note: The book command does not resolve the conflict by syntax or remove the conflict token; it simply removes the conflicting file and then allows PATH to commit again.
18. Output the contents of the specified file or URL.
-r PREV filename > filename (PREV is a previous version, you can also write a specific version number so that the output can be submitted)
[SVN (Ubuntu)] Ubuntu uses SVN