Linux-SVN commands

Source: Internet
Author: User
Tags svn update

In development, in addition to svn updates on the local folder, svn operations on the command line are also critical. The following lists some documents excerpted by the website:
1,Run the file checkout to the local directory.SVN checkoutPath (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 LibrarySVNAddFile
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 testfile for my test" test. php
Abbreviation: SVN Ci

4,Lock/unlockSVN lock-M "lockmessage"
[-- Force]
Path
For example, SVN lock-m "lock testfile"
Test. php
SVN unlockPath

5,Update to a specific versionSVN Update-RMpath
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 200test. php (restore the file test. php In the version library to version 200)
SVN updatetest. php (updated for version library synchronization. If an expiration prompt is prompted during submission, it is becauseConflict. Update the file first.And then clearSvnresolved, And then submit commit)
Abbreviation: svn up

6,View the file or directory statusSvn statusPath... (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)Svnstatus-vPath (display file and subdirectory status)
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 svnrevert commands can also be executed without a network, because svn retains the original copy of the local version in local. svn.
Abbreviation: svn st

7,Delete an objectSvn deletePath-m
"Delete test fle"
Example: svn delete svn: // 192.168.1.1/pro/domain/test. php-m
"Delete testfile"
Or directly delete svn test. php and then svn ci-m 'delete testfile'. We recommend that you use this
Abbreviation: svn (del, remove, rm)

8,Rename a file, directory, or fileSvn move-M "move
Test fle"
For example, svn move-m "move
Test file "a. phpB. php changes the name of a. php in the current directory to B. php.
Svnmove-m
"Move testfile" address admin/address: move the address directory under the current directory to the admin/address directory under the current directory.
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)

9,View logsSvn logPath
For example, svn log test. php displays all the modification records of this file and changes to its version number.

10,View File detailsSvn infoPath
Example: svn info test. php

11,ComparisonSvn diffPath (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

12,Merge the differences between the two versions into the current fileSvn merge-rM: npath
Example: svn merge-r 200: 205test. php)

13,SVN helpSvn help
Svn help ci

--------------------------

The above are common commands. Below are a few

--------------------------

14,List of files and directories in the version Library

Svn listPath
Displays all files and directories in the path directory that belong to the version library.
Abbreviation: svn ls

15,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 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 to wait for the next submission.
2. Each directory specified with a URL is created by submitting it to the repository immediately.
In both cases, all the intermediate directories must exist in advance.

16,Restore local modification

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. But it won't be restored.
Deleted directory

17,Code library URL change

SVN switch (SW ):Update the working copy to different URLs.
Usage: 1. switch URL [PATH]
2. switch-relocate from to [PATH...]

1. Update your work copy and map it to a new URL. The behavior is similar to "svnupdate" and
Merge files on the server with local files. This maps the work copy to a branch or tag in the same warehouse.
Method.
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 change), but the working copy is still mapped to the same directory in the same repository.
This command updates the correspondence between the working copy and the warehouse.

18,Resolve Conflicts

SVN resolved:Remove the "Conflict" Status of the directory or file of the working copy.
Usage: resolved PATH...
Note: subcommands do not follow the syntax to resolve conflicts or remove conflicting tags. They only remove conflicting tags.
Related files, and then allow the PATH to be submitted again.

19,Output the content of the specified file or URL.

SvncatTarget [@ 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)

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.