Common SVN commands in Linux

Source: Internet
Author: User
Tags svn update
Document directory
  • 1. Checkout the file to the local directory.
  • 2. Add new files to the version Library
  • 3. Submit the modified file to the version library.
  • 4. Lock/unlock
  • 5. Update to a specific version.
  • 6. view the file or directory status
  • 7. delete an object
  • 8. View logs
  • 9. View File details
  • 10. Differences
  • 11. Merge the differences between the two versions into the current file.
  • 12. SVN help
Source: http://www.jb51.net/ OS /RedHat/2461.html
1. Checkout the file to the local directory.

SVN checkout path (path is the directory on the server)
Example: SVN checkout SVN: // 192.168.1.1/Pro/Domain
Abbreviation: SVN Co
2. Add new files to the version Library

SVN add File
Example: SVN add test. php (add test. php)
SVN add *. php (add all PHP files in the current directory)
3. Submit the modified file 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 "add Test file for my test" 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. Update 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. view the file or directory status

1)SVN status path(The status of files and subdirectories under the directory. The normal status 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.
Abbreviation: SVN St
7. delete an object

SVN Delete path-m "delete test FLE"
For example: SVN delete SVN: // 192.168.1.1/Pro/domain/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)
8. View logs

SVN Log Path
For example, SVN Log Test. php displays all the modification records of this file and changes to its version number.
9. View File details

SVN info path
Example: SVN info test. php
10. Differences

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
11. Merge the differences between the two versions into the current file.

SVN merge-r m: N path
For example, SVN merge-r test. php (merge the differences between version 200 and version 205 to the current file, but there are usually conflicts. You need to handle them)
12. SVN help

SVN help
SVN help Ci
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.