CentOSSVN client application

Source: Internet
Author: User
Tags svn update
1. install TortoiseSVNyuminstall-ysubversion in CentOS II. SVN client Command 1. run the file checkout command to the local directory svncheckoutpath (path is the directory on the server), for example: svncheckoutsvn: // 192.168.1.1/pro/domain abbreviation: s...
I. install TortoiseSVNyum install-y subversion in CentOS II. SVN client Command 1. run the file checkout command 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 abbreviation: svn co 2. add a new file svn add file to the version library, for 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 the lock is selected, use the-no-unlock switch. for example, svn commit-m "add test file for my test" test. php abbreviation: s Vn ci 4. lock/unlock svn lock-m "LockMessage" [-- force] PATH for example: svn lock-m "lock test file" test. php svn unlock PATH www.2cto.com 5. update svn update-r m path to a specific version. for example, if svn update is not followed by a directory, by default, all files in the current directory and subdirectory are updated to the latest version. Svn update-r 200 test. php (restores the file test. php in the version library to version 200) svn update test. php (updated, synchronized in the version Library. If an expiration prompt is prompted during submission, it is because of a conflict. you need to update the file, modify the file, clear svn resolved, and then submit commit: svn up 6. view the file or directory status 1) svn status path (the status of the files and subdirectories under the Directory, the normal status 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) svn status-v path (display file and subdirectory status) the first column remains the same, the second column shows the working version number, and the third and fourth columns show the last modified version number and modifier. Note: svn status, svn diff, and svn revert commands can be executed without a network, because svn is locally deployed. svn retains the original copy of the local version. Abbreviation: 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 directly svn delete test. php and then svn ci-m 'delete test file'. we recommend that you use this abbreviation: svn (del, remove, rm) 8. view the svn log path, for example, svn log test. php displays all the modification records of this file, and changes to its version number. 9. view the details of the file svn info path, for example, svn info test. php 10. Differences: svn diff path (compare the modified file with the basic version) for example: svn diff test. php svn diff-r m: n pat H (differences between version m and version n) for example: svn diff-r 200:201 test. php abbreviation: svn di www.2cto.com 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 (merge the differences between version 200 and 205 to the current file, but there are usually conflicts, you need to handle it) 12. SVN help svn help ci ------------------------ The above are common commands, below are some commonly used files and directories in the version Library: svn ls 14. create a new directory under version control: 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 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. 15. restore local 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 will not restore the deleted directory 16. the code library URL changes svn switch (sw): updates the working copy to different URLs. Usage: 1. switch URL [PATH] 2. switch-relocate from to [PATH...] 1. update your working copy and map it to a new URL. the behavior is similar to "svn update", and the files on the server will be merged with local files. This is a method that maps a work copy to a branch or tag in the same repository. 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 changes ), however, when the working copy is still mapped to the same directory in the same warehouse, use this command to update the correspondence between the working copy and the warehouse. 17. resolve the conflict 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 files and then allow the PATH to be submitted again. Www.2cto.com 18. output the content of the specified file or URL. Svn cat target [@ 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) create and initialize version Library 1. create a code repository # svnadmin create/home/myrepos. in this way, we create the version Library myrepos in the/home directory. 2. initialize the code repository # mkdir-p code/{branches, tags, trunk}. according to the suggestions in the svn manual, the layout of our version library uses three directories such as branches, tags, and trunk. Then, you can copy the code directly to the trunk directory, or add it using svn add. # Svn import code file: // home/myrepos submit the constructed version library layout (and code, if copied to trunk) to the version Library. Because we operate locally, you can directly use the file protocol for submission. Format: file: // + the absolute path of the version Library is OK. here we have built a local version Library, you can use the svn ci method to obtain a copy of the version Library. If the layout of the version Library is submitted but the code is not submitted, run the following command to submit the version code: # svn co file: /// home/myrepos/trunk repos usually only extracts the source code from the main line directory trunk and stores it in the newly created repos directory. You can then copy the source code to the repos directory. Run the following two commands to add the version library to the code. # Svn add * # svn ci *-m "Committed codes" first, you need to add the copied code to the current copy, and then submit the code to the version Library. Author Long Shang
Related Article

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.