SVN common commands under Linux

Source: Internet
Author: User
Tags commit diff mkdir prev svn svn update


SVN command help:

Mac-pro:test root$ SVN--help

USAGE:SVN <subcommand> [Options] [args]
Subversion command-line client, version 1.7.10.
Type ' svn help <subcommand> ' in a specific subcommand.
Type ' svn--version ' to "the program version and RA modules
or ' svn--version--quiet ' to ' just the version number.

Most subcommands take file and/or directory arguments, recursing
On the directories. If no arguments are supplied to such a
command, it recurses on the current directory (inclusive) by default.

Available subcommands:
Add
Blame (praise, annotate, Ann)
Cat
Changelist (CL)
Checkout (CO)
Cleanup
Commit (CI)
Copy (CP)
Delete (Del, remove, RM)
diff (di)
Export
Help (?, h)
Import
Info
List (LS)
Lock
Log
Merge
Mergeinfo
Mkdir
Move (MV, rename, ren)
Patch
Propdel (Pdel, PD)
Propedit (Pedit, PE)
Propget (Pget, PG)
Proplist (plist, PL)
Propset (PSet, PS)
Relocate
Resolve
Resolved
Revert
Status (Stat, ST)
Switch (SW)
Unlock
Update (UP)
Upgrade

Subversion is a tool for version control.
For additional information, http://subversion.apache.org/

Attached to some of the corresponding Chinese instructions

1, checkout the file to the local directory
SVN checkout Path (path is a directory on the server)
For example: SVN checkout Svn://192.168.1.1/pro/domain--username Qinxiaohui
Shorthand: 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 under current directory)


3, the change of the file submitted to the version of the library
SVN commit-m "LogMessage" [-n] [--no-unlock] PATH (use the--no-unlock switch if you choose to keep the lock)
For example: SVN commit-m "Add test file for my test" test.php
Shorthand: 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 version
SVN update-r m path
For example:
SVN update If there is no directory behind it, the current directory and all files under the subdirectory are updated to the latest version by default.
SVN update-r test.php (restores the file test.php in the version library to version 200)
SVN update test.php (update, sync with version library). 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
1 SVN status Path (the state of the files and subdirectories under the directory, not shown in the normal state)
"?: not in the control of SVN; M: Content modified; C: conflict; A: scheduled to join repository; K: Locked
2 svn status-v path (displaying file and subdirectory status)
The first column remains the same, the second column displays the working version number, and the third and fourth columns display the last modified version number and the modified person.
Note: SVN status, SVN diff, and SVN revert these three commands can also be performed without a network, because SVN is local. SVN retains the original copy of the local version.
Shorthand: SVN St

7, delete the file
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 simply svn delete test.php and then svn ci-m ' delete test file ', recommend using this
Shorthand: SVN (del, remove, RM)

8, view the log
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
For example: SVN info test.php

10, compare the difference
SVN diff path (compares the modified file to the base version)
For example: SVN diff test.php
SVN diff-r m:n Path (diff for version M and version N)
For example: SVN diff-r 200:201 test.php
Shorthand: 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 (merges the differences between version 200 and 205 into the current file, but generally conflicts and needs to be addressed)

12, SVN Help
SVN help
SVN help CI

------------------------------------------------------------------------------
The above is the common command, below write a few commonly used
------------------------------------------------------------------------------

13, File and directory list under the version library
SVN list Path
Show all files and directories that belong to the version library under the path directory
Shorthand: SVN ls

14. Create a new directory under version control
SVN mkdir: Create a new directory under version control.
Usage:
1, mkdir PATH ...
2, mkdir URL ...

Create a directory for version control.
1. Each directory specified in the working copy PATH will be created on the local side and added
Schedule to be submitted for the next time.
2. Each directory specified as a URL will be created by submitting it immediately to the warehouse.
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:www.111cn.net
Usage: revert PATH ...
Note: The notebook command does not access the network and will remove the conflicting status. But it won't recover.
The deleted directory

16. Code base URL Change
SVN switch (SW): Updates the working copy to a different URL.
Usage:
1. Switch URL [PATH]
2. Switch--relocate from to [PATH ...]
1, update your working copy, map to a new URL, its behavior is similar to "SVN update", will also merge the server files and local files. This is the method of mapping 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 root URL of the warehouse changes (such as scheme name or host name change), but the working copy is still mapped to the same warehouse in the same directory, use this command to update the working copy of the warehouse and the corresponding relationship.

17. Conflict resolution
SVN resolved: Removes the conflicting state of a working copy's directory or file.
Usage: Resolved PATH ...
Note: The notebook command does not resolve the conflict by syntax or removes the conflict token; it simply removes the associated file for the conflict and then lets the PATH be resubmitted.

18, output the contents of the specified file or URL.
SVN cat Target [@ VERSION] ... If a version is specified, the lookup is started from the specified version.
SVN cat-r PREV filename > filename (PREV is the previous version, can also write specific version number, so that the output can be submitted)

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.