This article describes how to use common svn commands in Linux Command lines.
1. Execute the file checkout in the Linux Command Line to the local directory.
Svn checkout pathpath is the directory on the server)
Example: svn checkout svn: // 192.168.1.1/pro/domain
Abbreviation: svn co
2. Add a new file to the version library under the Linux Command Line
Svn add file
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 version library under the Linux Command Line.
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/unlock a Linux Command Line
Svn lock-m "LockMessage" [-- force] PATH
For example, svn lock-m "lock test file" test. php
Svn unlock PATH
5. Update a Linux Command Line to a specific version.
Svn update-r m path
For example:
If there is no directory after svn update, all files in the current directory and sub-directories are updated to the latest version by default.
Svn update-r 200 test. php (restore the file test. php In the version library to version 200)
Svn update test. php (updated for version library synchronization. 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)
Abbreviation: svn up
6. view the file or directory status in the Linux Command Line
1) the status of files and subdirectories under the svn status path 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 (displays the status of files and subdirectories)
The first column remains the same, the second column displays 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 files under the Linux Command Line
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 delete svn test. php and then svn ci-m 'delete test file'. We recommend that you use this
Abbreviation: svn (del, remove, rm)
8. View logs under Linux Command lines
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 File details under Linux Command lines
Svn info path
Example: svn info test. php
10. Differences in Linux Command lines
Svn diff path (compare the modified file with the basic version)
Example: svn diff test. php
Svn diff-r m: n path (differences between version m and version n)