Linux SVN command specific explanation

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

Detects if Svn:svnserve--version is installed

Shutdown of SVN service: Killall svnserve

Create SVN library:svnadmin create/opt/svn/repos

Configure your own active startup: Put Svnserve-d-r/opt/svn/repos on the last line of/etc/rc.d/rc.local

start svn:svnserve  - D  - r  / opt / svn / Repos

Assuming that there is already an SVN executing, it can be executed in a different port : Svnserve - D - R / opt / SVN / Repos -- Listen - Port 3391

1. checkout files to a local folder


SVN checkout Path (path is a folder on server)   for example: SVN checkout svn://192.168.1.1/pro/domain    shorthand: SVN co

2 . Add a new file to the version number library


  SVN Add File   Example: SVN add test.php (join test.php)   svn add *.php (Add all php files under the current folder)

3 . Submit the modified file to the version number library

SVN commit-m "LogMessage" [-n] [--no-unlock] PATH (assuming a hold lock is selected. Use--no-unlock switch)   example: SVN commit-m "Add test file for my test" test.php    shorthand: svn ci

4. Locking/Unlock

  SVN lock-m "Lockmessage" [--force] path   example: SVN lock-m "lock test file" TEST.PHPSVN unlock Path

5. Update to a version number

SVN update-r m path   For example:      SVN update assumes that there are no folders behind, by default, all files under the current folder and subfolders are updated to the latest version number.     svn update-r test.php (Restore the file test.php in the version number library to the version number)     SVN update test.php (updated, synchronized in the version number library.)

Suppose the prompt expires at the time of submission. Because of the conflict, you need to update, change the file, then clear the SVN resolved, and then commit the commit) shorthand: svn up


6. View file or folder status

1) SVN status path (status of files and subfolders under folder, normal status not shown)   "?

: Not in SVN's control. M: Content has been changed; A: scheduled to increase to version number library; K: Locked " 2) SVN status-v path (show file and subfolder status) the first column remains the same, and the second column displays the work version number. The third and fourth columns show the version number and the person who modified the last change. Note: The three commands for SVN status, SVN diff, and svn revert can be run without a network because SVN retains the original copy of the local version number in the local. SVN. Shorthand: SVN St


7. Delete Files

  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 straight After SVN delete test.php and then svn ci-m ' delete test file ', it is recommended to use this shorthand: SVN (del, remove, RM)

8. View Logs

  SVN log Path   example: SVN log test.php shows all changes to this file, and its version changes

9. View file specific information

  SVN info Path   Example: SVN info test.php
10, comparative difference

  SVN diff path (compare the changed file to the base version)   For example: SVN diff test.phpsvn diff-r m:n path (difference between version number m and version number N)   such as: SVN diff-r 200:201 test . PHP   shorthand: svn di

11 . Merge the differences between the two version numbers into the current file

  SVN merge-r m:n path   such as: SVN merge-r 200:205 test.php (the difference between version number 200 and 205 is merged into the current file, but there is a general conflict.) Need to deal with it)
12.SVN Help

  SVN helpsvn help CI

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

These are frequently used commands. Here are a few of the most frequently used

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

13 . List of files and folders under version number library

  SVN list path   displays all files and folders belonging to the version number library under the path folder shorthand: SVN ls
14 . Create a new folder under the control of the version number

SVN mkdir: Creates a new folder under the control of the version number that is included. How to use: 1, mkdir PATH ...         2. mkdir URL ... Create a folder with version number control. 1. Each folder specified in the working copy PATH will be created on the local side and added to the new schedule for the     next commit.

2. Each folder specified in the URL. will be created by submitting them to the repository immediately. In both cases, all intermediate folders must exist beforehand.


15. Restore Local changes

SVN revert: Restores the original unchanged working copy file (restores most of the local changes).

revert: How to use: Revert PATH ... Note: The notebook command will not access the network and will release the conflicting conditions. But it won't recover the deleted folder


16. Code Base URL Change

SVN switch (SW): Updates the working copy to a different URL. How to use: 1, switch URL [path]        2, switch--relocate from to [path ...] 1. Update your working copy. Map to a new URL. Its behavior is very similar to SVN update, and it merges the     files on the server with the local files. This is the method of matching the 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 repository changes     (for example, scheme name or host name change). However, the working copy still uses    this command to update the corresponding relationship between the working copy and the warehouse when it is mapped to the same folder in the same warehouse.

17. Conflict Resolution

SVN resolved: Removes the "conflicting" status of a working copy of a folder or file.

How to use: Resolved PATH ... Note: The book command does not resolve conflicts by syntax or remove conflicting tags. It is simply a file that removes the conflict . Then let PATH be able to submit again.


18 . Output the contents of the specified file or URL.

SVN cat Target [@ Version number] ... Assuming a version number is specified, it will start looking for the specified version number. SVN cat-r PREV filename > filename (PREV is the previous version number, can also write the detailed version number, so that the output can be submitted)





Linux SVN command specific explanation

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.