Server Side
Start SVN server: svnserve-d-R Repositorypath
-D means running in daemon mode (background run)
-R all directories under the specified directory
Check if it starts normally:Ps-ef|grep SvnserveClient side:
1. Checkout files to a local directory
SVN checkout Path (path is a directory on the server)
Example: SVN checkout Svn://192.168.1.1/pro/domain
Abbreviation: Svnco
2. Add a new file to the repository
SVN Add File
Example: svnaddtest.php (add test.php)
svnadd*.php (Add all php files in the current directory)
3. Submit the changed files to the repository
SVN commi t-m "LogMessage" [-n][--no-unlock]path (use--no-unlock switch if hold lock is selected)
Example: Svncommit-m "Addtestfileformytest" test.php
Abbreviation: Svnci
4. Locking/Unlock
SVN lock-m "Lockmessage" [--force]path
Example: Svnlock-m "Locktestfile" test.php
Svnunlockpath
5. Update to a version
SVN update-r MPath
For example:
Svnupdate If there is no directory at the back, the default is to update all files in the current directory and subdirectories to the latest version.
svnupdate-r200test.php (Restore the file test.php in the repository to version 200)
svnupdatetest.php (update, sync in Repository.) If the prompt expires at the time of submission, it is because of the conflict, need to update, modify the file, then clear the svnresolved, and then commit the commit)
Abbreviation: Svnup
6. View file or directory status
1) Svnstatuspath (Status of files and subdirectories under directory, normal status not shown)
"?: not in SVN control; M: Content modified; C: conflict; A: Scheduled to be added to Repository; K: Locked"
2) Svnstatus-vpath (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 three commands for Svnstatus, Svndiff, and Svnrevert can also be executed without a network, because SVN retains the original copy of the local version in the Local. SVN.
Abbreviation: svnst
7. Delete Files
Svndeletepath-m "Deletetestfle"
Example: Svndeletesvn://192.168.1.1/pro/domain/test.php-m "Deletetestfile"
or direct svndeletetest.php and then svnci-m ' Deletetestfile ', it is recommended to use this
Shorthand: SVN (DEL,REMOVE,RM)
8. View Logs
Svnlogpath
For example: svnlogtest.php shows all changes to this file, and its version number
9. View File Details
Svninfopath
Example: svninfotest.php
10. Compare Differences
Svndiffpath (compares the modified file to the base version)
Example: svndifftest.php
Svndiff-rm:npath (compare differences between version m and version N)
Example: svndiff-r200:201test.php
Abbreviation: Svndi
11. Merge the differences between the two versions into the current file
Svnmerge-rm:npath
For example: svnmerge-r200:205test.php (the difference between version 200 and 205 is merged into the current file, but there is a general conflict that needs to be addressed)
12. SVN help
Svnhelp
Svnhelpci
------------------------------------------------------------------------------
The above is a common command, the following write a few common
------------------------------------------------------------------------------
13. List of files and directories under the repository
Svnlistpath
Displays all files and directories belonging to the repository under the path directory
Abbreviation: SVNLS
14. Create a new directory under version control
Svnmkdir: Creates a new directory under the included version control.
Usage: 1, Mkdirpath ...
2. Mkdirurl ...
Create a version-controlled directory.
1. Each directory specified in the working copy path will be created on the local side and added
Scheduled to be submitted for the next time.
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 Modifications
Svnrevert: Restores the original unchanged working copy file (restores most of the local modifications). Revert
Usage: Revertpath ...
Note: The notebook command will not access the network and will release the conflicting condition. But it won't recover.
Directories that were deleted
16. Code Base URL Change
Svnswitch (SW): Updates the working copy to a different URL.
Usage: 1, Switchurl[path]
2, Switch--relocatefromto[path ...]
1, update your working copy, map to a new URL, its behavior is similar to "Svnupdate", will also
The files on the server are merged with the local files. This is the one where the working copy corresponds to a branch or tag in the same warehouse.
Method.
2, rewrite the working copy of the URL metadata to reflect the simple URL changes. When the root URL of the warehouse changes
(such as scheme name or host name change), but the working copy is still used when mapping to the same directory in the same warehouse
This command updates the correspondence between the working copy and the warehouse.
17. Conflict Resolution
Svnresolved: Removes the "conflicting" status of the working Copy's directory or file.
Usage: Resolvedpath ...
Note: The book command does not resolve the conflict by syntax or remove the conflict token; it simply removes the conflicting
File, and then allow path to submit again.
SVN Common Commands