SVN Command Use FAQ

Source: Internet
Author: User
Tags svn update

1. How do I add files?

SVN add filename

SVN ci-m "Add File"

2. SVN ci conflict

Often many people in the development of more than one person will inevitably modify the same file causes the conflict to be sent, or in the merge time also appears, when there is a conflict, svn up appears

Elect: (P) postpone, (DF) Diff-full, (e) Edit,//(P) delay, (DF) Show all differences, (e) Edit,

(MC) Mine-conflict, (TC) Theirs-conflict,//(MC) My version, (TC) Other people's version,

(s) Show all options://(s) display the full selection:

General select P, will download the conflict file to your local processing, you can see the test.txt (file merge version)  test.txt.mine (I modified version)   test . Txt.r21 ( others modified before version this )  t est.TXT.R 2 2 ( other people modified version) So many files, call on someone else to modify the test.txt merge version, modify the delete delete <<<<<<<. Mine, =======, and > >>>>>>. R22. Re-enter:

SVN resolve--accept Working test.txt (this command removes Test.txt.mine test.txt.r21 test.txt.r22)

SVN ci-m ' some comment ' a.txt

3. Version merging, normally a project may have multiple branches, what should I do when the branch needs to be merged?

eg: Suppose that branch 1 is to be merged into the trunk, locally switched to the branch 1 file directory, svn merge Other_svn_url, you can also specify the branch version to merge svn merge Other_svn_url- R22:head, there is a conflict such as 2 steps to resolve.

Finally remember, svn ci-m "xxx"

4. SVN delete accidentally deleted the wrong file how to recover

1) The first case of SVN delete filename But there is no commit (svn ci), then you can use the SVN revert filename

2) If you have already done so, you can restore by creating a new branch, first SVN log--verbose--stop-on-copy svn_repo_url view version history, using SVN cp [email protected] Des_url -M "XX" Creates a new branch, eg: assuming that the current R8 is a version number that contains no files deleted,

SVN cp http://www.svnrepo.com/project/branche1/@8 http://www.svnrepo.com/project/branche2-m "XXX" (Branche1 for previous SVN URL address directory, not less/, otherwise in the new branch file structure is branche2/branche1,@8 is the version number, and then in SVN co http://www.svnrepo.com/project/branche2, you can retrieve deleted files

3) If using the tool, please turn here

5. SVN diff detailed

$ svn diff-r 2:3 rules.txt
(1) Index:rules.txt
(2) ============================ =======================================
(3)---rules.txt (revision 2)
(4) + + rules.txt (Revision 3)
(5) @@- 1,4 +1,4 @@
(6) Be kind to others
(7)-freedom = Chocolate Ice Cream
(8) +freedom = Responsibility
(9) Eve Rything in Moderation
(Ten) Chew with your mouth open

First line, show file
second line, delimiter
Third line, old version with "-" means
Line fourth, new version with "+ "Means
Line fifth, the old version shows 1~4 line, the new edition shows 1~4 line
Sixth line, two versions have
seventh line, only the old version has
Eighth line, only the new version has
Nineth line, two versions have
Tenth line, two versions have
= = ==============

$ svn diff--revision Prev:committed foo.c
# shows committed to FOO.C

$ svn Log--revision HEAD
# shows log message for the latest repository commit

$ svn diff--revision HEAD
# compares your working file (with local mods) to the latest version
# in the repository.

$ svn diff--revision Base:head foo.c

# Latest version in the Repository

$ svn Log--revision Base:head
# shows all commit logs since your last updated

$ svn update--revision PREV foo.c
# rewinds The last change on foo.c.
# (FOO.C ' s working revision is decreased.)

SVN Command Use FAQ

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.