Directory
First, get information from the version library ... 1
Second, from the version of the library to the local ... 2
Third, from local to version library ... 2
Four, advanced application ... 4
First, get information from the version library
SVN help command
Get Child Command Description
SVN info $URL
View workspace Information
If the directory address, view the local directory information, if no $dir, default to the current directory
If file address, view local file information
SVN list
Displays files in a given directory that exist in a version
Svnlist displays a list of SVN record files in the current directory and does not access the version library
SVN list $URL not download files to the local view directory
Check history:
SVN log
View historical modification information, showing author and date information for each version attached to the version and all path modifications
SVN log 5:19 View historical information for version 5 to 19
SVN Log View history modification information for the current directory
SVN log filename View historical modification information for a single file
SVN log $URL View historical information for $url
SVN diff
Review the changes that show the details of each file change
SVN diff foo.c Compare local modifications
SVN diff--r 3 foo.c Compare working copies and version libraries
SVN diff--r 2:3 foo.c comparison version library and version Library
SVN revert delete your local modifications and revert to the state before the modification.
==============================================================
SVN diff Compare changes to local working copy
SVN diff filename compares changes to a working copy of a local file
SVN diff-r 3 filename Compare local working copy with version library specified version
SVN diff-r 2:3 $URL Two versions of the Compare version library
Local (working copy) and local modified version comparison, to accurately view the modified content, delete the previous line-, add a line before A +
Example: SVN diff web-inf/web.xml svn diff web-inf/classes/conf/*.properties
SVN cat
Print a specific version of a file on the screen
SVN cat-r 2 filename display file specified version content
SVN st [parameters]
"St=status"
Perform a check
"Unlike SVN diff: the SVN St shows only file modifications, not details."
SVN St $DIR view locally made changes
Parameters |
example |
&NBSP ; significance |
whether to contact the version Gallery |
The path |
SVN status |
View all catalog file information in current directory |
No, |
|
SVN status aa/a.txt |
View file information in the specified directory & nbsp; |
No |
-v |
svn status-v |
All directory file information in current directory, even if not changed |
No |
-u |
SVN status-u |
Compared to the latest version of the version library, * Prompt file needs to be updated |
is, compared to the latest version of the version library |
Usage: status [PATH ...]
(1) When no parameters are specified, only locally modified entries are displayed (no network access).
(2) When using-Q, only the summary information for locally modified entries is displayed. (1) and (2) almost, only local changes are displayed
(3) When using-u, displays the working version and the server version comparison
(4) When using-V, displays the full version information for each entry.
The first seven columns of the output occupy one character width:
First column: Indicates whether an item is added, deleted, or modified
"" No Modification
"A" increases
"C" conflict
"D" Delete
"I" ignores
"M" Change
"R" replace
"X" is not included in the version-controlled directory and is created by an externally referenced directory
"?" is not included in version control
"!" the item has been lost (removed by non-SVN command) or incomplete
"~" version controlled items with other types of items with duplicate names
two, from the version library to the local
SVN co $URL $DIR "Co=checkout"
Check out SVN library files to your local workspace
Check out the target file to a local directory, resume a working copy, each directory contains one. SVN admin directory
$URL and $dir siblings
If the local directory address is not added, the remote folder is copied to the current directory by default
SVN export $URL $DIR "usually used at the time of packing"
Export a clean directory tree from the version library, with SVN co but without. SVN directory
Non-working copy
SVN up "Up=update"
Update your local workspace and keep up with the SVN server
Output hint: U A D R G C
Update Add Delete replace merge conflict
SVN up updates the local workspace by default to update all files under the current directory and its subdirectories to the latest version
SVN up filename update filename is up to date
SVN up–r file.c–m "Update the version to 200" restores the local file.c to version 200 and submits it to the server "Local is taken down, the version library has not been changed"
Iii. from local to version libraries
SVN import $DIR $URL-m annotation information "Generate Commit action"
Import the directory under $dir into $url without creating a new directory under $url
That is, the content under Dir is copied to the URL
For example: There is a folder Test/code.java
SVN import Test $URL/test–m "Import a new file" to copy Code.java to the version Library Test folder
At this time, the local dir unchanged, local and server is not established management, need to perform checkout to remove the server content to actually create a working copy locally
Equivalent to copy from local to version library, source file is not related to version library file
To create a new directory SVN import $DIR $URL/$DIR
SVN add File "local operations"
Add a file or directory locally to the SVN ci before submitting
SVN add test test.c Add Test directory and test.c file
SVN Delete file
Delete a directory from a local job or URL, or remove a file
SVN del test test.c local workspace deletes the test directory and test.c to execute SVN ci when submitted, version added "Once Svndel, local folders or files are deleted"
SVN del $URL –m "del the Dir for some reason" produces submit, version added
SVN mv $URL/old $URL/new-m "annotation" "mv=move equivalent to svn cp after SVN delete"
Files/directories that move or copy workspace or version libraries can also be used for file renaming
SVN mv foo.cf.c workspace file name, using SVN ci to generate submit
SVN mv–m "Move a file" $URL 1 $URL 2 moving files, generating submissions
SVN rm $URL/dir-m "Notes"
Directory deletion
SVN ci-m "Annotation info" "Ci=commit"
Submit additions and deletions and change operations
Note that after submitting, the local SVN list is still old and requires manual svn up to get the latest
svn revert filename "local operation, will be lost modified, cautious use"
Restores changes to a file or directory to undo a local modification before the commit operation (CI) is performed.
Equivalent to performing SVN rm filename,svn up-r BASE filename
SVN revert–r $DIR Restore all changes in the workspace $dir directory
svn revert test.c Restore test.c modifications
SVN mkdir $URL/dir-m "notes"
Workspace or version library creation directory
SVN mkdirnewdir A new directory newdir the local workspace, generating submissions via SVN ci
SVN mkdir–m "Making a dir" $URL/$NEW Generate Submit _dir
SVN cp $URL 1 $URL 2-m "notes"
Mutual copies of files between working copies or versions of libraries
Origin (SRC) and destination (DST) can be a working copy path or address (URL):
Working copy-> working copy: copying and adding via scheduling (contains history)
Work copy-> address (URL): Immediately submit a work copy to address (URL)
Address (URL)-> working copy: Check out address (URL) to working directory, through scheduling into
Row increase
Address (URL)-> address (URL): Full server-side replication; general for branches and labels
SVN cp foo.txtbar.txt Local file copy
SVN cp $URL $dir Local new $url directory, $url directory will be placed under $dir
SVN cp $URL 1$url2–m "Note" to produce a submit operation
SVN cp $DIR $url–m "Note" to produce a submit operation
can also be used to create a new branch
After SVN co$url2, you can do it in a branch working copy, svn ci-m "fix bug 1031"
Retrieve the deleted item
None in current version, previous version exists
-Exact copy svn cp-r19 $URL/filename filename
-Check Results Svnstatus
-Submit SVN ci-m "resurrected C.txt fromr19"
Four, advanced application:
SVN merge–r m:n Path
Compare two version trees, apply differences to local copy initial version tree final version tree a work copy to receive the difference
Merging branches
-Find the version produced by the branch
SVN log-v--stop-on-copy $URL found that the version produced by the branch is R10
-Make the working directory a local copy of the backbone
$CD Proj/trunk
$SVN up
You can see the latest version, assuming R15
-Perform merge
$SVN merge-r 10:15 $URL
-Check the results of the merge, perhaps to manually resolve the conflict, and finally submit
$SVN ci-m "merged br_1_0 10:15 to Trunk"
Code rollback