CVS parallel version management. Beginner. 2-conflict and merge

Source: Internet
Author: User

CVS parallel version management. Beginner. 2-conflict and merge

After installing CVS (refer to CVS parallel version management. Beginner. 1-install and set up), familiarize yourself with the basic concepts of CVS.

Now, assume that the CVS server has a file named test. C and the version is 1.1.

Void Foo {
Printf ("");
}

 

 

I pulled the (check out) file test. C and modified it locally.

Another person's modifications are as follows and have already been submitted to the cvsserver. The file version on the CVS server has changed to 1.2.

Void Foo {
Printf ("another person ");
}

My changes are:

Void Foo {
Printf ("I ");
}

 

Because a new version already exists on the server, an error will occur when I submit the new version. We need to update the version first. During this update, the system prompts a conflict and requires manual merge.

My local file test. C is copied to a backup. # test. C.1.1, and test. C is changed to the following:

Void Foo {
<Test. c
Printf ("I ");
========
Printf ("another person ");
>>>>>>>> 1.2
}

It is obvious that the above is my program, the below is the server version of the program, different places are marked, modify and delete those signs, the program is as follows

Void Foo {
Printf ("another person \ n ");
Printf ("I ");
}

Submit the file again. The file version on the server is changed to 1.3.

Another person updated it and saw printf ("I ");

Next, modify different rows to see what is different.

Another person's modifications are as follows and have already been submitted to the cvsserver. The file version on the CVS server has changed to 1.4. Void Foo {
Printf ("another person modifies \ n ");
Printf ("I ");
}

My changes are:

Void Foo {
Printf ("another person \ n ");
Printf ("I want to change ");
}

 

 

Because a new version already exists on the server, an error will occur when I submit it. We need to update it first. This update shows that CVS automatically merges the files, as shown below:

Void Foo {
Printf ("another person modifies \ n ");
Printf ("I want to change ");
}

Submit the file again. The file version on the server is changed to 1.5.

-- By milula

Related

Concurrent Version Management of CVS. Beginner. 1-Installation and settings

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.