SVN command line

Source: Internet
Author: User
Tags svn client svn update

SVN version: 1.5 and later

Noun Description:

Wc:working Copy Your workspace

Versioned: Controlled; version-controlled

What is SVN?

    • SVN is an open source version control system.
    • More features than CVS. A better CVS? So SVN has most of the features that CVS has.
    • Not only is the file controlled, but the directory is also added to version control.
    • Copy, delete, rename these operations are controlled.
    • The metadata (attribute) of the special effect.
    • Commits the transaction atomicity. Any part of the submission will not be in effect until it is completed. The version number is based on the submission, not on the file. The log message at the time of submission is also dependent on the version being submitted.
    • Creating branches and tags is straightforward. You can create branches and tags simply by using the Copy command.
    • Merge traces. assist you with all change points when merging.
    • File lock. SVN supports file lock modification policy.
    • The UNIX link can be controlled. The prerequisite is that the WC must be under UNIX.
    • Optional Apache network server, based on the Webdav/deltav protocol. An administrator familiar with Apache will love this.
    • Built-in server selection (Svnserve). If you don't want to use Apache, try SVN's own server:svnserve. It can also provide authorization and authentication, SSH channel and other functions.
    • Easy to parse output. SVN's output is as easy as possible to read and facilitate machine parsing.
    • Conflict resolution is good interactivity. The SVN command-line client provides a number of different ways to resolve conflicts.
    • SVN provides a utility, Svnsync, for synchronizing from the main library to the read-only secondary library.
    • The persistent Write Agent feature allows a read-only subordinate library to handle all read requests exclusively. All write requests are given to the main library for processing. This feature is only valid when using Apache WebDAV server.
    • Based on the localization of the client server system, layered library, clear API to facilitate the expansion.
    • Efficient processing of binary files.
    • The performance consumption is proportional to the number of change points.
    • The SVN API can be integrated with multiple languages. Python,perl,java,ruby (svn itself is written in C)
    • changelists function.

SVN's installation sub-client and server.

You can find the download at the following address: http://subversion.tigris.org/

This article mainly describes the SVN client commands, you need to install at least the client. The default is version control with SVN. If you don't want to install the service version on your machine, Google code is a great place to practice SVN commands.

It is easy to apply for a hosting project on http://code.google.com, but SVN lock is not supported at this time. Currently, the maximum 1G space is supported.

The following is a list of common commands for SVN clients:

SVN add [path]

Alias: None

Description: Add a file or directory to your WC and hit the new tag. These files will be submitted to the SVN server the next time you submit the WC.

You can also revoke new files with SVN revert before committing.

Access library: No

EG:SVN Add File.cpp

SVN blame target[@REV]

Alias: Praise,annotate,ann

Description: Displays the last modified version and author of each line of a controlled file

Access Library: Yes

EG:SVN Blame File.cpp

EG:SVN blame--xml file.cpp # #加上xml参数可以以xml格式显示每一行的属性.

SVN cat target[@REV]

Alias: None

Description: Outputs the content of the specified target, where the target is usually a file.

Access Library: Yes

EG:SVN Cat File.cpp

EG:SVN Cat File.cpp-r 2 # #显示版本号为二的file. cpp content.

EG:SVN cat File.cpp--revision HEAD # #显示最新版本的file. cpp content.

SVN changelist clname TARGET ...

SVN changelist--remove TARGET

Alias: cl

Description: The files in the WC can be logically grouped.

Access library: No

EG:SVN cl Clname file.cpp file2.cpp file3.cpp # #将file. cpp etc three files added to the clname named Changelist

EG:SVN commit--changelist clname-m "CI" # #将clName下的所有文件提交

SVN checkout url[@REV] ... [PATH]

Alias: Co

Description: Check out

Access library: No

EG:SVN Checkout File:///var/svn/repos/test File:///var/svn/repos/quiz working-copies

EG:SVN checkout-r 2 File:///var/svn/repos/test Mine # #check out of project with version number 2

SVN cleanup [PATH ...]

Alias: None

Description: A recursive cleanup of expired locks and unfinished operations in the WC.

Access library: No

EG:SVN cleanup

SVN commit [PATH ...]

Alias: CI

Description: Submit your WC changes to the warehouse

Access Library: Yes

EG:SVN commit-m "added howto section." # #默认情况下提交必须提供log Message

SVN copy src[@REV] ... Dst

Alias: CP

Description: The copy operation can be from WC to WC;WC to Url;url to Wc;url to URL. Now SVN only supports copies of files within the same repository and does not allow cross-warehouse operations.

Access Library: Yes

EG:SVN copy-r file:///var/svn/repos/test/trunk \

File:///var/svn/repos/test/tags/0.6.32-prerelease \

-M "forgot to tag at Rev 11"

# #copy命令是创建分支和标记的常用方式. The copy-to-URL operation implies a commit action, so a log messages is required.

SVN Delete PATH ...

Alias: Del,remove,rm

Description: Delete

Access Library: If path is a library address, deleting the file inside the WC does not.

Eg:svn del Localfile.cpp # #删除WC里的文件, the next time you submit the WC, you will actually delete the corresponding file in the warehouse.

Eg:svn del File:///var/svn/repos/test/yourfile # #删除仓库里的文件

SVN diff

Alias: di

Description: Used to compare and display the modification point.

To access the library:

EG:SVN diff # #最常用的方式, used to display the WC based on all local modification points after the most recent update.

EG:SVN diff-r 301 Bin # # Compare the modified point of the bin directory in WC and version 301

EG:SVN diff-r 3000:3500 file:///var/svn/repos/myProject/trunk # #比较库里主干3000版和3500版的差异.

EG:SVN diff--summarize--xml http://svn.red-bean.com/repos/[email protected] http://svn.red-bean.com/repos/test ##-- The summarize--xml parameter displays the difference in the form of an XML document.

SVN export [-R REV] url[@PEGREV] [PATH]

SVN export [-R REV] path1[@PEGREV] [PATH2]

Alias: None

Description: Exports a clean directory tree that does not contain all the controlled information. You can choose to export from a URL or WC.

Access Library: If you are accessing a URL, you will.

EG:SVN export File:///var/svn/repos my-export # #导出到my-export directory.

SVN help-help!

Alias:?, h

Description: No need to explain.

Access library: No.

SVN import [PATH] URL

Alias: None

Description: Imports a local directory into the library. However, when imported, the local directory is not in a controlled state.

Access library: Yes.

EG:SVN import-m "New import" MyProj Http://svn.myProject.com/repos/trunk/misc

SVN info [target[@REV] ...]

Alias: None

Description: Displays the specified WC and URL information.

Access library: Only when the library path is accessed.

EG:SVN info--xml http://svn.myProject.com/repos/test # #将信息以xml格式显示.

SVN list [target[@REV] ...]

Alias: ls

Description: Displays a list of files and directories under the target.

Access Library: If you are accessing a library address, you will.

The EG:SVN list--verbose file:///var/svn/repos ##--verbose parameter represents the display details.

SVN lock TARGET ...

Alias: None

Description: Gets a modification lock on the target. If the target is locked by another user, a warning message is thrown. Use the--force parameter to force a lock from another user.

Access Library: Yes

EG:SVN Lock--force Tree.jpg

SVN log [PATH]

SVN log url[@REV] [PATH ...]

Alias: None

Description: Displays the log message from the library. Log Message Code a:added d:deleted m:modified r:replaced

Access Library: Yes

EG:SVN log-v http://svn.myProject.com/repos/test/foo.c bar.c # #详细显示指定URL的库中foo. C and bar.c All versions of the log information.

EG:SVN log-r 14:15 # #显示当前WC的14和15版本log信息.

eg:# #如果版本号不连续 can only be used in the following ways.

$ svn log-r > MyLog

$ svn log-r >> mylog

$ svn log-r >> mylog

SVN merge Sourceurl1[@n] sourceurl2[@m] [Wcpath]

SVN merge [email protected] [email protected] [Wcpath]

SVN merge [[-C M] ... | [-R N:m] ...] [source[@REV] [Wcpath]]

Alias: None

Description: Merges the differences of two controlled sources and stores them in a WC.

Access library: Only when the library address is accessed.

Eg:svn merge--reintegrate Http://svn.example.com/repos/calc/branches/my-calc-branch # #合并分支上的改变项到WC, often used for branching into the trunk.

EG:SVN merge-r 156:157 http://svn.example.com/repos/calc/branches/my-calc-branch # #将制定URL版本156到157的所有更新合并到WC.

SVN mkdir PATH ...

SVN mkdir URL ...

Alias: None

Description: Creating a directory in the WC or library path

Access library: Only when the library address is accessed.

EG:SVN mkdir Newdir

SVN move SRC ... Dst

Aliases: MV, rename, Ren

Description: Equivalent to the SVN copy command followed by an SVN delete command. A WC-to-url rename is not allowed.

Access library: Only when the library address is accessed.

EG:SVN move foo.c bar.c # #将foo. C renamed to Bar.c.

SVN propdel propname [PATH ...]

SVN propdel propname--revprop-r REV [TARGET]

Alias: Pdel, PD

Description: Removes attributes from controlled files, directories, and so on. The second is to delete the attached property on a specific version.

Access library: Only when the library address is accessed.

EG:SVN Propdel svn:mime-type somefile # #从someFile上移除svn: Mime-type this property.

SVN propedit propname TARGET ...

SVN propedit propname--revprop-r REV [TARGET]

Alias: Pedit, PE

Description: Edit Properties

Access library: Only when the library address is accessed.

EG:SVN propedit svn:keywords file.c # #修改file. C on the Svn:keywords property.

SVN propget propname [target[@REV] ...]

SVN propget propname--revprop-r REV [URL]

Alias: PGET,PG

Description: Gets the value of the specified property from a file, directory, or version.

Access library: Only when the library address is accessed.

EG:SVN propget svn:keywords file.c # #从file. C Gets the value of the Svn:keywords property

SVN proplist [target[@REV] ...]

SVN proplist--revprop-r REV [TARGET]

Alias: plist, pl

Description: Lists all attached properties on a file, directory, or version

Access library: Only when the library address is accessed.

EG:SVN proplist--verbose file.c

SVN propset propname [PropVal |-f Valfile] PATH ...

SVN propset propname--revprop-r REV [PropVal |-f valfile] [TARGET]

Alias: Pset,ps

Description: Attach a property to a file, directory, or version and assign a value

Access library: Only when the library address is accessed.

EG:SVN propset svn:mime-type image/jpeg file.jpg # #给file. jpg attached property svn:mime-type its value is Image/jpeg

EG:SVN propset--revprop-r svn:log "journaled about trip to New York."

# #给版本25补上log Message

EG:SVN propset svn:ignore '. Classpath '.

# #在本地忽略掉. classpath file

SVN resolve PATH ...

Alias: None

Description: Marks the conflicting file as resolved and deletes the temporary file from the conflict. Note that this command is not able to resolve conflicts, resolve conflicts or rely on labor.

Access library: No

Eg:svn Resolve--accept mine-full foo.c # #1.5, add the--accept parameter, and try to automatically handle the conflict.

SVN resolved PATH ...

Alias: None

Description: Obsolete, replaced by resolve--accept. Removes conflicting state and conflict temp files.

Access library: No

svn revert PATH ...

Alias: None

Description: Restores all local changes in the WC.

Access library: No

Eg:svn revert--depth=infinity. # #将整个目录所有文件还原

SVN status [PATH ...]

Alias: Stat, St

Description: Outputs the status of files and directories in the WC. If the WC is submitted, these States are synchronized to the vault.

The general state has ' no modification '

' A ' added

' D ' Delete

' M ' modification

' R ' alternative

' C ' conflict

' I ' ignore

‘?‘ Not controlled

‘!‘ Loss, which is generally caused by direct deletion of the controlled file

Access Library: When you add the--show-updates parameter, you

EG:SVN Status WC

SVN switch url[@PEGREV] [PATH]

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

Alias: SW

Description: Shift the WC to a different library address synchronization

Access Library: Yes

EG:SVN SW http://svn.myProject.com/repos/trunk/vendors. # #将当前WC切换到另一个URL

SVN unlock TARGET ...

Alias: None

Description: Unlocking

Access Library: Yes

EG:SVN Unlock Somefile

SVN update [PATH ...]

Alias: Up

Description: Update the WC, there are several categories of update feedback.

A New

B Lock Destruction

D Delete

U Update

C conflict

G merger

E Existence of

Access Library: Yes

EG:SVN Up-r22 # #更新到一个指定版本

PS: How to remove the user authorization password saved in SVN

Locate the Auth/svn.simple directory under the Subversion installation directory and delete the following files.

If you are in a turtle, you can setting->saved data->authentication data point clear.

Reference: http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.checkout.html

SVN command line

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.