5 SVN command Introduction
Check the project to the user directory: SVN checkout URL [path]
SVN checkout SVN: // localhost/itcast F: \ develop \ workroom \ User
SVN checkout SVN: // localhost/itcast/F: \ develop \ workroom \ user2
Output content:
######################################## ###
# A user \*.*#
#.......#
# Retrieve version 1 #
######################################## ###
Submit the modified file to the version Library: SVN commit-M "log des" Path
Modify the hellothewrold. jsp file in the user document, modify some content, and then submit it to the version Library:
SVN commit-M "This is the first commit" F: \ develop \ workroom \ User \ hellothewrold. jsp
(If the current directory is already user, you only need SVN commit-M "This is the first commit" hellothewrold. jsp)
Output content:
######################################## ###
# Sending hellothewrold. jsp #
# Transferring file data #
# The submitted version is 2 #
######################################## ###
Update your work copy: SVN update [path...]
We updated the modified content of hellothewrold. jsp to the user2 directory.
Go to the user2 directory
Cd f: \ develop \ workroom \ user2
SVN update
Or
SVN update F: \ develop \ workroom \ user2
The input content is as follows:
######################################## ###
# U f: \ develop \ workroom \ user2 #
##
# Update to version 2 #
######################################## ###
Note: updates must be updated frequently, and problems should be exposed as soon as possible to facilitate handling.
Update the code before submitting the code. Otherwise, a version conflict may occur.
Add a new file to the version Library: SVN add path...
Create a new file usert. Java in the user and add it to the version Library:
SVN add F: \ develop \ workroom \ User \ usert. Java
Input content:
######################################## ###
# A usert. Java #
##
######################################## ###
OK. After adding the file, we will update it to the user2 directory:
Go to the user2 directory
Cd f: \ develop \ workroom \ user2 \
SVN update F: \ develop \ workroom \ user2
Output content:
######################################## ###
# Version 2 #
##
######################################## ###
However, the usert is not updated.
Added to the version library, the file is not submitted, so we need to submit:
SVN commit-M "this is the usert class" F: \ develop \ workroom \ User \ usert. Java
Output content:
######################################## ###
# Add usert. Java #
# Transfer file data. #
# The submitted version is 3 #
######################################## ###
OK. We will update user2 again:
SVN update F: \ develop \ workroom \ user2
Output content:
######################################## ######
# A f: \ develop \ workroom \ User \ usert. Java #
##
# Update to version 3 #
######################################## ######
Delete a file from the version Library: SVN Delete path...
Suppose we want to delete the usert. Java file under User:
SVN Delete F: \ develop \ workroom \ user2 \ usert. Java
Output content:
######################################## ######
# D F: \ develop \ workroom \ User \ usert. Java #
##
##
######################################## ######
Note that SVN Delete will not be deleted from the version library immediately, but will be submitted and deleted next time.
SVN commit-M "delete this class" F: \ develop \ workroom \ User \ usert. Java
Delete a file from the version library and then cancel the delete operation: SVN revert path...
Suppose we want to delete hellotheworld. jsp
SVN Delete hellotheworld. jsp
Output content:
######################################## #############
# D F: \ develop \ workroom \ User \ hellotheworld. jsp #
##
##
######################################## #############
But we don't want to delete it at this time. We can:
SVN revert hellotheworld. jsp
Output content:
######################################## #############
# Recovered hellotheworld. jsp #
##
##
######################################## #############
Displays local or remote entry information SVN info
The information of the local user directory is displayed.
First, go to our workroom directory.
SVN info user
Displays the svn list of entries in the version library.
We display the itcast entries in the current library.
SVN list SVN: // localhost/itcast
View the status of the current workspace SVN status
Go to the workspace directory, that is, the user directory.
SVN status
The system lists the files to be added, deleted, or updated.
Generally, there are the following types of headers:
A add
D. Delete
U update
C conflict
G merge
Obtain help information: SVN help...
Suppose we want to view how to use the checkout command in the svn Client Command
SVN help checkout
Obtain the help information of the add command: SVN help
SVN help add is equivalent to SVN add -- Help