The SVN command uses a detailed

Source: Internet
Author: User
Tags svn update

1. Check out svn CO/HTTP path (full path of directory or file) [local directory full path]--username user name--password password SVN co svn://path (full path to directory or file) [local directory full path]--username   Username--password Password SVN checkout/HTTP path (full path to directory or file) [local directory full path]--username username svn checkout svn://path (full path to directory or file) [local directory full path]  --username User Name Note: If the password is transmitted without the--password parameter, you will be prompted to enter the password, it is recommended that you do not use the Clear text--password option.  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 tool/home/testtools--username WZHNSCSVN Co http://localhost/test/testapp--username WZHNSCSVN Checkout svn://localhost/Test tool/home/testtools--username wzhnscsvn Checkouthttp://localhost/test/testapp--  Username WZHNSC2, 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 username SVN export [-R version number] svn://path (full path to directory or file) [local directory full path]--username username SVN export locally checked out (i.e. with. SVN folder) directory full path to export local directory full path NOTE: The first one to export a clean working directory tree from a repository   The form is the specified URL, and if a revision number is specified, the corresponding version is exported and, if no revision is specified, the most recent, 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, but notFiles are not copied under version control (that is, new files that are not submitted because the. SVN folder does not have information records associated with it). Example: SVN export svn://localhost/test tool/home/testtools--username WZHNSCSVN export Svn://localhost/test/testapp--username WZHNSCSVN EXPORT/HOME/TESTAPP/HOME/TESTTOOLS3, add new files svn add filename Note: Tell the SVN server to add files, but also use SVN commint-m real upload up! Example: SVN add test.php <-added test.php svn commit-m "add my Test with test.php" TEST.PHPSVN add *.php <-Add all php files under current directory svn commit-m "Tim Add my test with all php files "*.PHP4, submit svn commit-m" Submit Memo Message Text "[-n] [--no-unlock] filename svn ci-m" Submit Memo Message Text "[-n] [--no-unlock] File name must be with the-m parameter  , parameters can be empty, but must be written on the-m example: SVN commit-m "submit all under version control files in the current directory" * <-Note this * means all files svn commit-m "Submit my Test with test.php" TEST.PHPSVN commit -M "Submit my Test with test.php"-N--no-unlock test.php <-keep the lock on with the –no-unlock switch svn ci-m "submit all under version control files in the current directory" * <-Note this * indicates all files svn ci- M "Submit my Test with test.php" TEST.PHPSVN ci-m "submit my Test with test.php"-N--no-unlock test.php <-hold lock with –no-unlock switch 5, update file SVN updatesvn up DATE-R fix version filename SVN update file name example: SVN update <-No directory, by default, all files in the current directory and subdirectories are updated to the latest version of SVN update-r test.cpp <-The files in the repositoryTest.cpp revert to the revised version (revision) 200SVN update test.php <-update is synchronized 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" is recommended as follows: SVN delete filename svn ci-m "Delete Note Information text" Example: SVN delete svn://localhost/ Testapp/test.php-m "Delete test file test.php" recommends the following: SVN delete test.php svn ci-m "Delete test file test.php" 7, locking/Unlock svn lock-m "Lock notes Message text" [- -force] FileName svn unlock file name example: SVN lock-m "lock letter Test with test.php file" test.php svn unlock Test.php8, compare diff svn diff filename svn diff-r fix  Number m: Fixed version number n filename example: SVN diff test.php<-compares the modified file to the underlying version of SVN diff-r 200:201 test.php<-to the revision version number 200 and the revision number 201 Compare the Difference 9, view the file or directory status SVN St Directory path/name SVN status directory path/name <-directory in the state of files and subdirectories, the normal status does not show "?: Not in SVN control; M: content is modified; C: conflict; A: Scheduled to be added to the repository; K: Locked "svn-v directory Path/name SVN status-v directory path/name <-display file and subdirectory status" the first column remains the same, the second column shows the work version number, the third and fourth columns show the last modified version number and the modification People "Note: SVN status, SVN diff, and SVN revert three commands can be executed without a network, because SVN retains the original copy of the local version in the Local. SVN. 10. View Log svn log file name example: SVN log test.php<-Show all changes to this file, and change the version number 11, view file details svn info file name example: SVN info test.php12, SVN help svn assist <-all features Options svn helps CI <-description of specific features 13, view List of files and directories under repository SVN list svn://path (full path to directory or file) SVN ls svn://path (full path to directory or file) Example: SVN list svn://localhost/testsvn ls svn:// Localhost/test <-displays all files and directories belonging to the repository under Svn://localhost/test directory 14, creating a new directory under version control SVN mkdir directory name svn mkdir-m "New directory Memo text"/http Directory full path example: SVN mkdir newdirsvn mkdir-m "Making a new dir." Svn://localhost/test/newdir Note: After adding subdirectories, be sure to go back to the root directory to update, Otherwise, submitting the file in this directory will prompt "commit failed" SVN update Note: If you manually create a new folder in the checkout directory Newsubdir, and then use the SVN mkdir newsubdir command, SVN will prompt: svn: try "svn  Add "or" svn add--non-recursive "instead? SVN: Unable to create directory "Hello": The file already exists at this time, with the following command to resolve: SVN add--non-recursive newsubdir in the Newsubdir folder, with Ls-a to view all the directories and files below it, will find more:. s VN Catalog Re-use SVN mkdir-m "Add Hello Function module file" Svn://localhost/test/newdir/newsubdir command, SVN hint: Svn:file already exists:filesyst Em '/data/svnroot/test/db ', transaction ' 4541-1 ', path '/newdir/newsubdir ' 15, restore 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 revert foo.c <-discard changes to a file svn revert--recursive. <-restores a whole directory of files. For current directory 16, update the working copy to another URL svn switch//directory full path local directory full path example: SVN switch http://localhost/test/456. <-(formerly 123 Branch) current directory branch to localhost/test/45617, conflict resolution SVN resolved [local directory full PATH] Example: $ svn Updatec foo.cupdated to revision 31. If you get conflicted during the update, your working copy will generate three new files: $ lsfoo.cfoo.c.minefoo.c.r30foo.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 http://localhost/test/readme.txt19, create a new branch COPYSVN copy Brancha branchb-m "Make B branch"//Copy a new branch from Brancha branchB20, merge content to branch MERGESVN merge Brancha BRANCHB//merge changes to Brancha into 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.