The SVN command uses a detailed

Source: Internet
Author: User
Tags create directory svn update

1. Check out svn CO/HTTP path (full path of directory or file) [local directory full path]

--username username--password Password SVN co svn://path (full path to directory or file) [local directory full path]--username user name--password password SVN checkout/HTTP/path ( Full path to directory or file) [local directory full path]--username user name svn checkout svn://path (full path to directory or file) [local directory full path]--username user name Note: If you transfer the password without the--password parameter   , you are prompted to enter a password, and the--password option for clear text is not recommended.   Among them username and password before is two short-term, not one. Does not specify a local directory full path, it is checked out to the current directory. Example:SVN co svn://localhost/Test Tools/home/testtools --usernameWzhnscSVN CO/HTTPLocalhost/test/testapp--usernameWzhnscsvn checkout svn://localhost/Test Tools/home/testtools --usernameWzhnscSVN Checkout/ httpLocalhost/test/testapp--usernameWzhnsc
2,Export (Export a clean directory tree without the. SVN folder) SVN export [-R version number]/HTTP path (full path to directory or file) [local directory full path]--username user name
SVN export [-R version number] svn://path (full path to directory or file) [local directory full path]--username user name
SVN export locally checked out (i.e. with. SVN folder) directory full path to export local directory full path
Note: The first way to export a clean working directory tree from the repository is to specify the URL,
If a revision number is specified, the corresponding version is exported, and if no revision is specified, the most recent export is exported to the specified location.
If the local directory full path is omitted , the last part of the URL is the name of the local directory.
The second form is to specify the local checked-out directory full path to the local directory full path to be exported, and all local modifications will be preserved.
However, files that are not under version control (that is, new files that are not submitted because the. SVN folder does not have information records associated with it) are not copied. Example:
SVN Export
svn://localhost/Test Tools/home/testtools --username Wzhnsc svn export svn://Localhost/test/testapp--username Wzhnsc svn export /home/TestApp/home/testtools
3. Add new files svn Add file name Note: Tell SVN server to add files, but also use SVN commint-m real upload up! Example:SVN addtest.php<-Add test.phpSVN commit-m"Add my test with test.php" test.phpSVN add*.php<-Add all PHP files in the current directorySVN commit-m"Add my test with all PHP files" *.php
4. Submit SVN Commit-m "Submit Memo Message Text" [-n] [--no-unlock] file name svn ci-m "Submit Memo Message Text" [-n] [--no-unlock] File name must take the-m parameter, parameter can be empty, but must write on-m example ChildSVN commit-m"Submit all files under version control in the current directory" *<-Note This * indicates all filesSVN commit-m"Submit my Test with test.php" test.phpSVN commit-m"Submit my Test with test.php"- N--no-unlocktest.php<-Keep the lock on and use the –no-unlock switch.SVN ci-m"Submit all files under version control in the current directory" *<-Note This * indicates all filesSVN ci-m"Submit my Test with test.php" test.phpSVN ci-m"Submit my Test with test.php"- N--no-unlocktest.php<-Keep the lock on and use the –no-unlock switch.
5. update file SVN update svn update-r fix version filename SVN update filename Example:SVN update there is no directory behind <-, and all files under the current directory and subdirectories are updated to the latest version by defaultSVN update-r Test.cpp <- Restore the file Test.cpp in the repository to the revised version (revision)SVN update test.php <- the update synchronizes with the repository. When submitting a prompt for expiration conflicts, you need to update the file first, then clear the SVN resolved, and then commit the commit.
6. Delete Files svn delete svn://path (full path of directory or file)-M "Delete Note information text" recommends the following actions:SVN DeleteFilenameSVN ci-mExample of "Delete notes message text":SVN Delete svn://localhost/testapp/test.php- M"Delete test file test.php" recommends the following:SVN Deletetest.phpSVN ci-m"Delete test file test.php"
7, locking/Unlock svn lock-m "Lock Memo Message text" [--force] filename svn unlock file name example:SVN lock-m"Lock letter Test with test.php file" test.phpsvn unlocktest.php
8, compare the difference svn diff filename svn diff-r fix version number m: Fixed version number n File name example:SVN difftest.php<-Compare the modified file to the base versionSVN diff-r200:201 test.php<-Difference between revision number 200 and revision number 201
9. View file or directory status SVN St directory path/name SVN status directory path/name<-Status of files and subdirectories under directory, normal status does not show "?: Not in SVN control; M: Content modified; C: conflict; A: Scheduled to add to Repository; K: Locked" svn-v directory Path/name SVN STA Tus-v directory Path/Name<-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 modifier "Note: SVN status, SVN diff, and SVN revert are three Commands can be executed without a network, because SVN retains the original copy of the local version in. svn.
10. See the Log SVN logs file name example:SVN logtest.php<-Shows all changes to the file, and its version number
11. View file details svn info file name Example:SVN infotest.php
12. SVN Help for SVN<-All feature options svn help CI<-Description of specific functions
13. View the list of files and directories under the repository. SVN list svn://path (full path of directory or file) SVN ls svn://path (full path to directory or file) example:SVN list svn://Localhost/testsvn ls svn://Localhost/test<-Showsvn://All files and directories in the Localhost/test directory that are part of the repository
14. Create a new directory under version control SVN mkdir directory name svn mkdir-m "New directory Memo text"/HTTP/Directory full path Example:SVN mkdirNewdirSVN mkdir-m"Making a new dir."svn://Localhost/test/newdir Note: After adding subdirectories, be sure to go back to the root directory update, or in this directory to submit the file will prompt "Commit failed"SVN updateNote: If you manually create a new folder in the checkout directory, NewsubdirSVN mkdirNewsubdir command, SVN will prompt: svn: Try to use "svn add" or "svn add--non-recursive" instead? SVN: Unable to create directory "Hello": File already exists at this time, use the following command to resolve:svn add--non-recursiveNewsubdir in this Newsubdir folder, with Ls-a to see all the directories and files below it, you will find more:. SVN directory and then svn mkdir-m "Add Hello Function module file" Svn://localhost/test/newdi R/newsubdir command, SVN hint: svn:file already exists:filesystem '/data/svnroot/test/db ', transaction ' 4541-1 ', path '/ne Wdir/newsubdir '
15. Restore the locally modified svn revert [--recursive] File name Note: The book command will not access the network and will release the conflicting condition. However, it does not restore the deleted directory. Example:svn revertFoo.c<-Discard changes to a filesvn revert--recursive.<-Restore a whole directory of files,. For the current directory
16. Update the working copy to a different URL svn switch/HTTP/directory full path local directory full path example:SVN switch/HTTP /localhost/test/456.<-(formerly 123 Branch) is currently located in the directory branch tolocalhost/test/456
17, resolve the conflict SVN resolved [local directory full PATH] Example: $ svn update C foo.c Updated to revision 31. If you get conflicted during the update, your working copy will generate three new files: $ ls foo.c foo.c.mine foo.c.r30 foo.c.r31 When you have resolved the FOO.C conflict and are ready to commit, run SVN Resolved let your working copy know that you've done everything. You can just delete the conflicting files and commit, but SVN resolved in addition to deleting the conflicting files, and also fixed some records in the work copy management area of the record data, so we recommend you use this command.
18. Do not checkout and view the contents of the output specific file or URL svn cat/HTTP file full path example:SVN cat/HTTPLocalhost/test/readme.txt

19. Create a new branch copy

svn copy brancha branchb-m "make B branch"//Copy a new branch from Brancha BRANCHB

20. Merge content to branch merge

svn merge Brancha BRANCHB//merge changes to Brancha to branch BRANCHB

The SVN command uses a detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.