Common svn commands in Linux Command lines

Source: Internet
Author: User
Tags svn update

1. Execute the file checkout in the Linux Command Line 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 a new file to the version library under the Linux Command Line

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 changed files to the version library under the Linux Command Line.

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 a Linux Command Line

Svn lock-m "LockMessage" [-- force] PATH

For example, svn lock-m "lock test file" test. php

Svn unlock PATH

5. Update a Linux Command Line 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 in the Linux Command Line

1) svn status path (the State of the files and subdirectories under 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.

Abbreviation: SVN St

7. delete files under the Linux Command Line

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 under Linux Command lines

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 under Linux Command lines

SVN info path

Example: SVN info test. php

10. Differences in Linux Command lines

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. In the Linux Command Line, 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 in Linux Command Line

Svn help

Svn help ci

The above are common commands. Below are a few

13. List of files and directories in the version library under the Linux Command Line

Svn list path

Displays all files and directories in the path directory that belong to the version library.

Abbreviation: svn ls

14. Create a new directory under version control under Linux Command Line

Svn mkdir: Create a new directory under version control.

Usage: 1. mkdir PATH...

2. mkdir URL...

Create a version control directory.

1. Each directory specified by the working copy PATH will be created on the local end and added to the new scheduling for the next submission.

2. Each directory specified by URL is created by submitting it to the repository immediately. In both cases, all the intermediate directories must exist in advance.

15. Restore local modification under Linux Command Line

Svn revert: restore the original unchanged working copy file (recover most local modifications ). Revert:

Usage: revert PATH...

Note: The sub-commands do not access the network and will release the conflict. However, it does not restore the deleted directory.

16. URL change of the code library under the Linux Command Line

Svn switch (sw): update the working copy to different URLs.

Usage: 1. switch URL [PATH]

2. switch-relocate from to [PATH...]

1. update your working copy and map it to a new URL. The behavior is similar to "svn update", and the files on the server will be merged with local files. This is a method that maps a work copy to a branch or tag in the same repository.

2. Rewrite the URL metadata of the working copy to reflect the changes on the simple URL. When the root URL of the Repository changes (for example, the solution name or host name changes ), however, when the working copy is still mapped to the same directory in the same warehouse, use this command to update the correspondence between the working copy and the warehouse.

17. Resolve Conflicts in Linux Command lines

Svn resolved: the "Conflict" Status of directories or files that remove working copies.

Usage: resolved PATH...

Note: subcommands do not follow the syntax to resolve conflicts or remove conflicting tags. They only remove conflicting files and then allow the PATH to be submitted again.

18. output the content of the specified file or URL under the Linux Command Line.

Svn cat target [@ version]… If a version is specified, search for it from the specified version.

Svn cat-r PREV filename> filename (PREV is the previous version, you can also write a specific version number, so that the output result can be submitted)

The above describes how to use common svn commands in Linux Command lines.

(From: http:// OS .51cto.com/art/200908/143157.htm)

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.