instructions used under linux svn

windows under the TortoiseSVN is a plug-in resource manager, to cover icon indicates the file status, so the command has almost a graphical interface support, relatively easy to use, do not say here. Mainly to talk about linux under the svn, because under linux most of the operations are carried out via the command line, you must have mastered the commonly used command under linux svn. Of course, there are the linux imitation of TortoiseSVN linux X program, such as RabbitVCS, a high degree of imitation, but it is easy to slow down the X, and is not recommended.

(如果是第一次提交文件,很可能会出现“svn:'.'不是工作副本”,即当前目录不是工作副本,这个时候需要用到import:

EG:. Import svn url)
1, the checkout files to a 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 CO
2, to the repository add new files
svn add file
For example: svn add test.php (added test.php)
svn the Add * .php (add all the files in the current directory php)
submit 3, the changed files to the repository
svn commit -m "LogMessage" [-N] [-no -unlock] PATH ( if selected to maintain lock on the use -no-unlock switch)
example: svn commit -m "add test file for my test" test.php
shorthand: svn ci
4, lock / unlock
svn lock -m "LockMessage" [-force ] pATH
For example: svn -m Lock "Lock the Test File" test.php
svn uNLOCK the pATH
5, update to a version
svn update -rm path
example:
svn If you do not update the directory later, the default will be the current directory and all files in subdirectories are updated to the latest version.
svn update -r 200 test.php (the version of the library file test.php revert to version 200)
svn Update test.php (updated, synchronized with the repository. If you are prompted expired at the time of filing of the case, because the conflict, need first update, modify the file, and then clear the svn resolved, and finally submitted to commit)
shorthand: svn up
6, view the file or directory state
1) the state of the files and subdirectories under the svn status path (directory, the normal state is not displayed)
【?: svn not in control; M: the content is modified; C: conflict; a: is added to the predetermined repository; K: the locked state is generally more] M
2) svn status -v path (display status of files and subdirectories)
of one remains the same, the second column shows the working version, the third and fourth columns show the last modified version and modify people.
Note: svn status, svn diff, and svn revert command in the absence of these three cases the network can also be performed, because svn retain the local version of the original copy in the local .svn.
Shorthand: svn ST
7, delete files
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 svn delete test. php then svn ci -m 'delete test file' , we recommended to use this
shorthand: svn (del, remove, rm )
8, view the log
svn log path
For example: svn log test.php shows the change records all modifications of the file, and the version number
9, view file details
svn info path
For example: svn info test.php
10, the difference
svn diff path (the modified file Compare with base)
example: svn the diff test.php
the svn the diff -rm: n path (version n to version differences and m)
, for example: svn diff -r 200: 201 test.php
shorthand: svn DI
. 11, the difference between the two versions in the current file
svn merge -rm: n path
example: svn merge -r 200: 205 test.php ( the difference between 200 and the version 205 into the current file, but usually in conflict, need to deal with it)
12, sVN help
svn help
svn help CI
--------------------------
These are commonly used commands, the following not often used to write several
--------------------------
13, files and directories in the repository list
svn list path
display directory path All belong to the repository of files and directories
Shorthand: svn LS
14, create a new directory under version control
svn mkdir: create a new directory under version control.
Usage: 1, the PATH ... mkdir
2, the URL of ... mkdir
to create a directory under version control.
1, each designated by a working copy of the PATH directory, is created locally end, and adding new
schedule, to be submitted at once.
2, each directory specified by a URL, is created in the repository via an immediate commit.
In both cases, all the intermediate directories must already exist.
15, to restore the local modifications
svn revert: Restore pristine working copy file (undo most local edits). revert:
Usage: revert PATH ...
Note: this subcommand does not require network access, and resolves conflict situation. But it does not restore
removed directories
16, the code base URL change
svn switch (sw): Update the working copy to a different URL.
Usage: 1, Switch the URL of [the PATH]
2, the FROM Switch -relocate the TO [the PATH ...]
1, update your working copy to mirror a new URL, its behavior with the "svn update" like, will also be on the server file with the local file merge. This is a working copy of the correspondence to the same warehouse in a branch or tag method.
2, URL rewriting working copy metadata to reflect changes in simple URL. When the root URL changes warehouse
(Such as program name or hostname change) but your working copy still reflects the same directory use the same repository for
this command to update the working copy of the correspondence between the warehouse.
17, to resolve the conflict
svn resolved: "conflict" state to remove the working copy of the directory or file.
Usage: resolved PATH ...
Note: this subcommand does not semantically resolve conflicts or to remove conflict markers; it merely removes conflict
-related documents, and then let the PATH to be committed again.
18, the contents of the specified output file or URL.
svn cat TARGET [@ REV] ... If the specified version, the version from the specified start looking.
svn cat -r PREV filename> filename ( PREV is the previous version, you can also write the specific version number, so that the output can be submitted)
link:
http://blog.chinaunix.net/uid/22976768.html

Guess you like

Origin blog.csdn.net/Nash_Cyk/article/details/79103572