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