Linux svn command Daquan

  
1, check 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 shorthand: svn co2, add to the repository The new file svn 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 file to the repository 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 shorthand: Svn ci4, lock/unlock svn lock -m “LockMessage“ [--force] PATH For example: svn lock -m “lock test file“ test.phpsvn unlock PATH5, update to a version svn update -rm path :svn update If there is no directory afterwards, all files in the current directory and subdirectories are updated to the latest version by default. Svn update -r 200 test.php (restore the file test.php in the repository to version 200) svn update test.php (update, sync in the repository. If the prompt expires when submitting, it is because of conflict, need First update, modify the file, then clear svn resolved, and finally submit commit) shorthand: svn up6, view file or directory status 1) svn status path (the status of files and subdirectories under the directory, normal status is not displayed) [?: not Svn control; M: content is modified; C: conflict occurs; A: scheduled to join the repository; K: 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 the modified person. Note: The three commands svn status, svn diff, and svn revert can be executed without a network because svn keeps the original copy of the local version in the local .svn. Shorthand: svn st7, 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 direct svn delete test .php and then svn ci -m ‘delete test file‘, recommend using this shorthand: svn (del, remove, rm) 8, view the log svn log path eg svn log test.php display all changes to this file , and its version number changes 9, view file details svn info path For example: svn info test.php10, compare the difference svn diff path (compare the modified file with the base version) For example: svn diff test.phpsvn diff -rm: n path (different for version m and version n) For example: svn diff -r 200:201 test.php shorthand: svn di11, merge the difference between the two versions into the current file svn merge -rm:n path For example: Svn merge -r 200:205 test.php (merge the difference between version 200 and 205 into the current file, but generally there will be conflicts, need to be dealt with) 12. SVN help svn helpsvn help ci———— & mdash; & mdash; & md ash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; upper common commands, write the following several non- frequently used & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash; & mdash ;——13, file and directory list under the repository svn list path shows all the files and directories belonging to the repository in the path directory: svn ls14, create a new directory under the version control svn mkdir: create the included version New directory under 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 side and added to the new schedule for the next commit. 2. Each directory specified by the URL will be created by submitting it immediately to the repository. In both cases, all intermediate directories must exist beforehand. 15. Restore local modifications svn revert: Restore the original unchanging working copy file (recover most of the local modifications). Revert: Usage: revert PATH… Note: This subcommand does not access the network and will resolve the conflict. But it does not restore the deleted directory. 16. The codebase URL changes 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 is similar to “svn update” It will be on file with the local file server consolidation. This is the method of mapping a working copy to a branch or tag in the same repository. 2, URL rewriting working copy metadata to reflect changes in simple URL. Use this command to update the correspondence between the working copy and the repository when the root URL of the repository changes (such as the schema name or host name changes), but the working copy is still mapped to the same directory in the same repository. 17. Resolve conflicts svn resolved: Remove the "conflict" status of the directory or file of the working copy. Usage: resolved PATH… Note: This subcommand does not resolve conflicts or remove conflict tags by syntax; it simply removes the conflicting related files 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, it will be looked up from the specified version. Svn cat -r PREV filename > filename (PREV is the previous version, you can also write the specific version number, so the output can be submitted)
Copyright © Windows knowledge All Rights Reserved