Common code "Go" for SVN under Linux

Source: Internet
Author: User
Tags diff svn update

Transferred from: http://www.2cto.com/os/201205/130192.html

1. Checkout files to a local directory

SVN checkout Path (path is a 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 repositorySVN 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 changed files to the repositorySVN commit-m "LogMessage" [-n] [--no-unlock] PATH (use –no-unlock switch if hold lock is selected) Example: SVN commit-m "Add test file for my test "test.php shorthand: svn ci 4. Locking/UnlockSVN lock-m "Lockmessage" [--force] path example: SVN lock-m "lock test file" TEST.PHPSVN unlock Path 5. Update to a versionSVN update-r m path for example: SVN update if there is no directory behind it, the default is to update all files in the current directory and subdirectories to the latest version. SVN update-r test.php (Restore files from the repository test.php to version) SVN update test.php (update, sync to Repository. 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 file or directory status1) SVN status path (status of files and subdirectories under directory, normal status not shown) "?: Not in SVN control; M: content is modified; C: conflict; A: Scheduled to add to Repository; K: Locked" 2) SVN status-v path (   Show file and subdirectory status) the first column remains the same, the second column shows the work version number, and the third and fourth columns show the last modified version number and the modified person. Note: The SVN status, SVN diff, and SVN revert three commands can be executed without a network, because SVN retains the original copy of the local version in. svn. Shorthand: SVN St 7. Delete FilesSVN delete path-m "delete test Fle" For example: SVN delete svn://192.168.1.1/pro/domain/test.php-m "Delete test file" or direct SV N Delete test.php and then svn ci-m ' delete test file ', it is recommended to use this shorthand: SVN (del, remove, RM) 8. View LogsSVN log path For example: SVN log test.php shows all the changes to this file and its version number 9. View File DetailsSVN info Path Example: SVN info test.php 10. Compare DifferencesSVN diff path (compares the modified file to the underlying version) for example: SVN diff test.phpsvn diff-r m:n path (compare differences 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 fileSVN merge-r m:n Path Example: SVN merge-r 200:205 test.php (the difference between version 200 and 205 is merged into the current file, but will generally conflict and need to be processed) 12. SVN HelpSVN helpsvn help Ci —————————————————————————— above is a common command, write below a few common —————————————————————————— 13. List of files and directories under the repositorySVN list path displays all files and directories belonging to the repository in the path directory shorthand: SVN ls 14. Create a new directory under version controlSVN mkdir: Create a new directory under the included version control.         Usage: 1, mkdir PATH ... 2. mkdir URL ... Create a version-controlled directory. 1. Each directory 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 directory specified in the URL will be created by submitting it to the repository immediately. In both cases, all intermediate directories must exist beforehand. 15. Restore Local ModificationsSVN revert: Restores the original unchanged working copy file (restores most of the local modifications). revert: Usage: revert PATH ... Note: The notebook command will not access the network and will release the conflicting condition. But it does not restore the deleted directory 16. Code Base URL ChangeSVN switch (SW): Updates 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 is similar to "SVN update", will also be the server above Merge with local files. This is the method that corresponds a 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 repository's root URL changes (such as scheme name or hostname change), but the working copy is still mapped to the same directory as the same repository, use this command to update the corresponding relationship between the working copy and the warehouse. 17. Conflict ResolutionSVN resolved: Removes the "conflicting" status of the working Copy's directory or file. Usage: Resolved PATH ... Note: The book command does not resolve the conflict by syntax or remove the conflict token; it simply removes the conflicting file and then allows PATH to commit again. 18. Output the contents of the specified file or URL. SVN cat Target [@ VERSION] ... If a version is specified, the lookup starts 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 can be submitted) Resolve Conflicts  First, use the Update option for conflict resolution, which means that the-accept parameter is used as a conflict handling method   --accept ARG       Regardless of whether the current copy copy is the latest version      : Specify automatic conflict resolution action                            (' postpone ', ' base ', ' mine-conflict ',                              ' theirs-conflict ', ' mine-full ', ' theirs-full ',                              ' edit ', ' launch ')   (p) &nbs P;postpone    -mark the conflict to be resolved later//Let files remain in conflict after the update is complete. (DF) diff-full  -Show all changes made to merged file//use standard distinguished format to show the difference between the base revision and the conflicting file itself. (e)  edit        -Change merged file in an editor//open conflicting files with your favorite editor, the editor is set by the environment variable editor. (r)  resolved    -Accept merged version of File//finish editing the files, notify SVN that you have resolved the file conflict, it must accept the current content-essentiallyYou have "solved" the conflict. (MF) mine-full  -Accept my version of entire file (ignore their change//discard the new changes received from the server and use only the local modifications that you view the files. (TF) theirs-full-accept their version of entire file (lose my changes)//discard your local modifications to the view file, using only the newly received changes from the server. (l)  launch      -Launch external tool to resolve conflict//start an external program to perform conflict resolution, which requires some advance preparation.

(h) Help-show this list//displays all commands that may be used in conflict resolution

Common code "Go" for SVN under Linux

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.