[Linux] svn merge command (command usage, resolve conflict, code rollback) __linux

Source: Internet
Author: User
Tags rollback svn
Use of the SVN merge command

What does the merge do? A personal understanding is to turn your local code into what you specify as the version code and to display the difference files. Basic methods of use are known, in order to deepen the impression I am here to do a bit of AH ^_^ Note: The following "XXXX" refers to the version

1. SVN merge url-c xxxx./XXXX version of the code specified by URL, merge to local;

2. SVN merge Url-r xxxx:yyyy./XXXX version of code specified by URL to yyyy version, merge to local (note: This method does not include XXXX version. )

Insert two small notes:

(1) If you currently want to merge the code with your local operation code belongs to a branch you can not specify the URL ....

(2) In order to prevent the merge error, we can add--dry-run to simulate the merge operation on the basis of the above command:

SVN merge url-c xxxx./--dry-run

SVN merge Url-r xxxx:yyyy./--dry-run

Adding--dry-run just simulates implementing the merge behavior rather than actually doing it ...

The merge action will see each of the files you merge into the local front has a U (means to be updated) A (means to add) D (for deletion) G (indicates that there is a conflict but has been resolved) to resolve the conflict generation method

Why does conflict occur? SVN is stored by diff, if the local changes and SVN on your merge changes are on the same line will be a conflict, think he did not know which to choose (svn meng le) ...

For conflicting files, we need to have three solutions in our own way:

(1) deal with the problem by oneself:

First select: E

Then open the conflicting file through Vim, enter/^=== can find the location of the conflict and resolve the conflict, save the exit, select R to indicate that the conflict has been resolved by you.

(2) Select the files on SVN:

Selection: TC

(3) Select Local file:

Selection: MC Code rollback

What is the code rollback? Suppose your current version is 4420 SVN commit after the version becomes 4221, but you have regrets, want to change the current code back to 4420 what to do? At this point you're going to use the code to roll back, and it's useless to use SVN revert for a commit, and you'll need to use SVN merge url-c-4421, and then the SVN commit file, now the version goes up to 4422 but and 4420 of the Cod The content of E is exactly the same .... (Why?) I am also a state of shock, need to savor.


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.