The SVN common command __linux under Linux

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

Windows TORTOISESVN is a resource manager of a plug-in, to overwrite the icon to indicate file status, almost so the command has a graphical interface support, more useful, here is not much to say. The main talk about the use of SVN under the Linux, because most of the operation of Linux is done through the command line, so you must master the common instructions for SVN under Linux.     Of course Linux also has imitation tortoisesvn Linux x programs, such as Rabbitvcs, high degree of imitation, but easy to slow down x, so it is not recommended. (If you are submitting a file for the first time, you'll probably get "svn:". is not a working copy, that is, the current directory is not a working copy, and import is required at this time. For example: SVN import. Url


The SVN command encyclopedia under Linux

1, checkout files 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
Shorthand: SVN Co

2 . Add a new file to the version Gallery svn add file
For example: SVN add test.php (add test.php)
SVN add *. PHP (Add all php files in current directory)

3, the change of the file submitted to the version of the library

SVN commit -M "LogMessage" [-n] [--no-unlock] PATH (if you choose to keep the lock, use it – No-unlock switch)
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 the file or directory status 1svn status Path (the state of the files and subdirectories under the directory, the normal state does not appear)
"?: not in the control of SVN; M: Content modified; C: conflict; A: scheduled to join repository; K: Locked
2svn 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 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 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 (compare modified file to base version)
For example: SVN diff test.php
svn diff -R m:n Path (diff between 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 helps svn help
SVN help CI

——————————————————————————

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

——————————————————————————

13 . File and directory listings under the version Gallery 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 changes svn revert: Restore the original unchanged working copy file (restore most of the local changes). Revert
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): update 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 and "SVN update" is similar, will also
The file on the server is merged with the local file. This corresponds to a branch or tag in the same warehouse where the working copy is
Method.
2, rewrite the working copy of the URL metadata to reflect the simple URL changes. When the root URL of the warehouse changes
(for example, schema name or host name change), but the working copy is still mapped to the same directory in the same warehouse.
This command updates the working copy's correspondence with the warehouse.

17 . Resolve the conflict SVN resolved: removes the conflicting status of a working copy's directory or file.
Usage: Resolved PATH ...
Note: The notebook command does not resolve the conflict according to syntax or remove the conflict token; it simply removes the conflicting
Related files, and then allow PATH to be submitted again.

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.