Common svn code in linux

Source: Internet
Author: User
Tags svn update
1. run the file checkout to the local directory svncheckoutpath (path is the directory on the server), for example: svncheckoutsvn: // 192.168.1.1/pro/domain abbreviation: svnco2: add a new file svnaddfile to the version library, for example, svnadd...


 

1. checkout the file 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 new files to the version LibrarySvn add file 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 you choose to keep the lock, use the-no-unlock switch) for example: svn commit-m "add test file for my test" test. php abbreviation: svn ci 4. lock/unlockSvn lock-m "LockMessage" [-- force] PATH for example: svn lock-m "lock test file" test. phpsvn unlock PATH 5. update to a specific version.Svn update-r m path. for example, if svn update is not followed by a directory, all files in the current directory and subdirectory are updated to the latest version by default. 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. 6. view the file or directory status1) svn status path (the state of the files and subdirectories under the Directory, and 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) 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 an objectSvn 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 svn ci-m 'delete test file'. we recommend that you use this abbreviation: svn (del, remove, rm) 8. View LogsSvn log path, for example, svn log test. php, displays all the modification records of this file, and changes to its version number. 9. View file detailsSvn info path, for example, svn info test. php 10. DifferencesSvn diff path (compare the modified file with the basic version) for example: svn diff test. phpsvn diff-r m: n path (different from version m and version n) for example: svn diff-r 200:201 test. php abbreviation: 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 (merge the differences between version 200 and version 205 to the current file, but there are usually conflicts. you need to handle them) 12. SVN helpSvn helpsvn help ci ------------------------ The above are commonly used commands. below I will write a few uncommonly used -------------------------- 13. list of files and directories in the version LibrarySvn list path: displays all files and directories in the path directory that belong to the version Library. short for: svn ls 14. create a new directory under version controlSvn 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 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 modificationSvn 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. However, it does not restore the deleted directory. 16. code library URL changeSvn switch (sw): Update 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. conflict resolutionSvn resolved: the "conflict" status of directories or files that remove working copies. 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. 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) Resolve ConflictsFirst, use the update option to resolve the conflict. that is to say, whether the current copy is the latest version or not, The-accept parameter is used as the conflict processing method -- accept ARG: specify automatic conflict resolution action ('postone', 'base', 'Mine-conflict ', 'Theirs-conflict', 'Mine-full', 'Theirs-full ', 'Edit', 'launch') (p) postpone-mark the conflict to be resolved later // keeps the file in conflict state after the update is complete. (Df) diff-full-show all changes made to merged file // display the differences between the base version and the conflicting file in a standard format. (E) edit-change merged file in an editor // Use your favorite EDITOR to open conflicting files. the editor is set by the environment variable EDITOR. (R) resolved-accept merged version of file // after the file is edited, notify svn that the file conflict has been resolved, it must accept the current content-essentially, you have "fixed" the conflict. (Mf) mine-full-accept my version of entire file (ignore their change // discard the changes received from the server, and only use the local modifications of the file you view. (Tf) theirs-full-accept their version of entire file (lose my changes) // discard your local modifications to the view file and only use new changes received from the server. (L) launch-launch external tool to resolve conflict // start an external program to execute conflict resolution, which requires some preparation in advance. (H) help-show this list // display all commands that may be used when the conflict is resolved
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.