The SVN command uses a detailed

Source: Internet
Author: User
Tags svn update

1. Check out:

SVN co/HTTP Path [full path to directory over file] [local directory full path]--username username--password password;

SVN co scn://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 pass the password without the--password parameter, you will be prompted to enter the password, and 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/testools--username Goodamusepackgey

SVN Co http://localhost/test/testapp--username Goodamusepackgey

SVN checkout svn://localhost/test tool/home/testtools--username Goodamusepackgey

SVN checkouthttp://localhost/test/testapp--username Goodamusepackgey

2. Export: (Export a clean directory tree without the SVN folder)

SVN export [-R version #]http://[directory or file full path] [local directory full path]--username username

SVN export [-R version #]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 the local directory full path

Note: The first type of clean working directory tree exported from the repository is the specified URL;

If a revision number is drawn, the corresponding version is everywhere,

If no revision is specified, the latest export is exported to the specified location.

If omitted, local directory full path to export local directory full path, all local modifications will be preserved;

The second form is to specify the local checked out directory full path to the local directory full path to be exported, 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) will not be copied.

Example:

SVN Export svn://localhost/test tool/home/testtools--username Goodamusepackgey

SVN export Svn://localhost/test/testapp--username Goodamusepackgey

SVN export/home/testapp/home/testtools

3. Add a new file;

SVN add file name;

Note: Tell the SVN server to add files, but also with SVN commint-m really upload up;

Example:

SVN add test.php <-added test.php

SVN commit-m "add my Test with test.php" test.php

SVN add*php <-Add all php files in the current directory

SVN commit-m "add my test with all PHP files" *php

4. Submission;

SVN commit-m "Submit Memo Message Text" [-n] [--no-unlock] File name

SVN ci-m "Submit Memo Text" [-n] [--no-unlock] File name must be with the-m parameter, parameters can be empty, but must be written on-m

Example:

SVN commit-m "Submit all Files under version control in the current directory" *<-Note this * indicates all files

SVN commit-m "submitted to my Test with test.php" test.php

SVN commit-m "Submit to my Test with test.php"-n--no-unlock test.php <-keep the lock on with the-no-unlock switch

SVN ci-m "Submit all Files under version control in the current directory" *<-Note this * indicates all files

SVN ci-m "Submit my Test with test.php"-n--no-unlock test.php<-hold the lock with the-no-unlock switch

5. Update the file;

SVN update

SVN update-r fix version file name

SVN update file name

Example:

There is no directory behind SVN update <-, which updates the current directory and all files in the directory to the latest version by default

SVN update-r test.php <-The files in the repository test.cpp revert to the revised version (revision) 200

The SVN update test.php <-update is synchronized with the repository. When submitting an expired conflict, you need to update the file first, then clear the SVN resolved, and commit the commit at the end.

6. deleting files

SVN delete svn://path (full path to directory or file)-M "Delete Note information text"

The following actions are recommended:

SVN Delete file name

SVN ci-m "Delete Note information text"

Example:

SVN delete svn://localhost/testapp/test.php-m "Delete test file test.php"

The following actions are recommended:

SVN Delete file name

SVN ci-m "Delete Note information text"

Example:

SVN delete svn://localhost/testapp/test.php-m "Delete test file test.php"

The following actions are recommended:

SVN Delete test.php

SVN ci-m "Delete test file test.php"

7. Locking/Unlock

SVN lock-m "Lock Memo Message text" [--force] File name

SVN unlock file name

Example

SVN lock-m "lock letter Test Trial test.php file" test.php

SVN unlock test.php

8. Compare differences

SVN diff file name

SVN diff-r fix version number m: Fixed version number n file name

Example:

SVN diff test.php <-to compare the modified file to the base version

SVN diff-r 200:201 test.php <-The difference between the revision and the fixed version number 201

9. View file or directory status

SVN St directory Path/Name

SVN status directory path/name <-directory under the state of files and subdirectories, normal state does not show [?: Not in SVN control; M content is modified; C: There is a conflict

A: Subscription to the repository; K: Locked]

Svn-v directory Path/Name

SVN status-v directory Path/name <-displays the status of files and subdirectories [first: column remains the same; second; column displays the work version number;

Third and fourth: show the last modified version and the modified person]

Note: The 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 Logs

SVN log file name

Example:

SVN log test:php <-shows all changes to the file and its version number;

11. View the details of a file

SVN info file name

Example:

SVN info test:php

12.SVN Help

SVN help <-all features options

Description of the specific features of the SVN help CI <-

13. View a list of files and directories under the repository

SVN list svn://path (full path to directory or file)

SVN list svn://path (full path to directory or file)

Example:

SVN list Svn://localhost/test

SVN ls svn://localhost/test <-displays all files and directories belonging to the repository in the Svn://localhost/test directory

14. Create a new catalog under the included version control

SVN mkdir directory Name

SVN mkdir-m "New directory Memo text"/HTTP/Directory full path

Example:

SVN mkdir Newdir

SVN mkdir-m "Making a new dir" Svn://localhost/test/newdir

Note: If you manually put a new folder in the checkout out of the directory Newsubdir, and then use the SVN mkdir newsubdir command, SVN will display:

SVN: Trying to replace with "svn add" or "svn add--non-recursive"?

SVN: Unable to create directory "Hello": File already exists

At this point, use the following command to resolve;

SVN add--non-recursive Newsubdir

In this Newsubdir folder, with Js-a to see all of his following directories and files, will find more: SVN directory, and then use the SVN mkdir-m "Add Hello Function Module file"

Svn://localhost/test/newdir/newsubdir command,

SVN hints;

Svn:file already Exists:filesystem "/data/svnroot/test/db", Transaction "4541-1".

Path "/newdir/newsubdir"

15. Restore Local Modifications

svn revert [--recursive] file name

Note: The notebook command will not access the network and will be exposed to conflicting conditions. But it does not restore the deleted directory.

Example

svn revert foo.c <-discard changes to a file

SVN revert--recursive. < restore a whole directory of files,. For the current new directory;

16. Update the work copy to another URL

SVN switch/HTTP/directory full path local directory full path

Example:

SVN switch http://localhost/test/456. <- (formerly 123 Branch) current directory branch to localhost/test/456

17. Conflict resolution

SVN resolved [local directory full path]

Example:

$ SVN update

C foo.c

Updated to revision 31.

If you get a conflict 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 submit, run SVN resolved and let your working copy know that you have done everything.

You can just delete the conflicting files and commit, but SVN resolved in addition to deleting the conflicting files, but also fixed some records in the work copy management area of the record data,

So we recommend that you use this command.

18. View the contents of the output specific file or URL without checkout

SVN CAT/HTTP/File full path

Example:

SVN cat Http://localhost/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 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.