12 Command practices of the Linux SVN management tool.

Source: Internet
Author: User
Tags svn update

SVN (subversion) is a version management tool that has emerged in recent years. SVN servers run in two ways: independent servers and Apache. The two methods have their own advantages and disadvantages. In either way, various commands are required. In this article, we will introduce common commands of Linux Svn in combination with examples.

 

1. Checkout the file to the local directory.

SVN checkout path (path is the directory on the server) for example: SVN checkout SVN: // 192.168.1.1/Pro/domain Abbreviation: SVN Co

2. Add new files to the version Library

SVN add file for 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. phpsvn unlock path

5. Update to a specific version.

SVN update-r m path. For example, if SVN update is not followed by a directory, all files in the current directory and subdirectory are updated to the latest version by default. SVN Update-R 200 test. php (restores the file test. php In the version library to version 200) SVN update test. php (updated, synchronized in the version library. 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.

6. view the file or directory status

1) SVN status path (the State of the files and subdirectories under the directory, and 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 (display file and subdirectory status) the first column remains the same, the second column shows 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,
The reason is that SVN retains the original copy of the local version in local. SVN. 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 SVN delete test. PHP and 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, for example, SVN info test. php

10. Differences

SVN diff path (compare the modified file with the basic version) for example: SVN diff test. phpsvn diff-r m: N path (different from version m and version n) for 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 200:205 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 helpsvn help ci

 

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.