A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service
The most basic function of a version control system is to record the changes each time, and allow users to conveniently access different versions and compare version differences. Furthermore, a multi-person development environment can be set up to count the modifications of each person to solve version conflicts. Version conflict occurs when two people modify a file at the same time. For example, the current database version is, A and B take out the two files respectively (this action is usually called checkout). After some modifications are made, a first saves the changed data (this action is usually called checkin ), at this time, the problem has not occurred, and the database board is updated to B, but when B checkin, the problem arises, and the version of B is also changed from, should I use the modified version of A or B? If we fix the changes made by Party A with the version of Party B, all the work of Party A will be wasted. The most common solution is to use the file lock function, that is, when a Jia modifies a file, it will add a lock flag to the file to let everyone know, this file is being modified. Do not change it. However, for advanced version control systems such as CVS, even if there is no file lock action, the two versions of merge can be upgraded in case of version conflicts.
There are currently many commercial and open source version control systems. in the open source code field, SCCs was the first to emerge, and then evolved into an RCS. these two versions are based on individual files for version control. later, we came up with CVS, which is based on the RCS architecture and can process the delivery of multiple files (that is, as mentioned by the version control software, I have changed these files, remember these changes ).
RCS (Revision Control System)
A fairly old tool. Although we all use cvs for version control, there is no way to use it if there is no CVS server available, the RCS is mainly used by individuals. It does not have many powerful functions like CVs and does not support remote file system access.
However, it is quite useful when you only need a simple version management function. It is recommended that you try to use the RCs to manage versions when writing programs or files on the workstation. At first, you may feel that you have bound your feet by hand, however, after a long time, you will surely find that using a version control system is really beneficial!
It is quite simple to use the RCs, and there are only a few commands. Most systems contain them.
The simple method is as follows:
1. Establish an RCS Database
First, create a directory named "RCS" under the directory of the program code to be saved.
2. log on to the RCS database.
At this time, the RCS will ask you to enter the log, that is, to record what you have to say to this version, simply say a few words, of course, you can also do it, then you will be given an initial version number, which should be 1.1. You will find that the original file is missing, and there is an additional file named filename and V in the rfms Directory, which is used to record the version evolution history of filename.
3. Extract the file
If the file is gone, what else can you play and sing? Of course, you can take it out:
The most basic usage is to obtain the latest filename version.
However, note that its attribute is read-only. The-l parameter must be added to indicate that the lock operation can be modified, after checking the file back, the version update is completed. The version number is 1.2.
In addition, co-r filename can retrieve the specified version, but its attribute must be read-only.
4. Save the modified files back to the RCS Database
The same is true for CI filename. However, you can add the-u parameter to unlock the file. If you want to edit the file, add-L. Otherwise, the file in the original directory will be automatically deleted.
5. view the modification record of an archive
Comparison version differences
Rcsdiff-R [version] filename
The general method of use is so simple. With the basic version control system concept, it is quite easy to use advanced version control systems such as CVS and subversion.
CVS (Concurrent Versions System)
CVS is a new generation of program development and maintenance systems following traditional maintenance tools such as RCs. Nowadays, many open source projects on the network use cvs for version control, it has the following features:
Storage and maintenance of program code versions
Tracing and backtracking of program code versions
Division control of program code versions
Supports collaborative development projects
Remote Management and Maintenance of program code
Anonymous interception of program code
In addition, CVSup and CVs are two different things. The former is mostly a tool for users to conveniently synchronize program code with developers, it compares the source code cvs id table between the server and client to determine which files need to be modified, which has a great advantage in speed. Another advantage of using CVSup is that it can replicate the entire cvs repository on your local machine, allowing quick local use of CVS operations, such as log and diff.
CVS is used by developers. However, many open source projects provide anonymous CVs, and generally only have the read permission. To get the desired version for other users, the main function is to give the latest developed program code to people who like fresh goods, so that everyone can test it together and develop a project, it is quite helpful.
CVS does not support renaming files. that is to say, if we want to change the name of an archive, the changes and comments that it was previously tired of have to be discarded. it also does not support changes in the directory unit, so it is impossible to reply to the directory content at a certain time.
In addition, we will introduce some easy-to-use CVS interfaces.
Wincvs: Win32 environment, but I think it is quite difficult to use.
Cervisia: the cvs gui of Kde, which can be integrated with Konqueror and feels very friendly.
A better set of CVS! It is also open source code, and the architecture, command column program interface, and so on, all deliberately mimic CVs, in order to allow users who are familiar with CVS to quickly get started.
Directory Version Control
In CVs, a directory has no version history. if the original directory named Doc/is found to be manual/after a period of time, we can only create a new manual /, copy the files under the DOC/directory, add the files under manual/to the CVS system, and delete the files. it must be noted that, during the process of copying and deleting archives, we also lost the history of these archives. the most important data of Version Control is lost!
However, in subversion, directories and files are also included in version control. that is to say, we can request the Subversion to restore a file to the status at a certain time point at any time, or change the directory name.
In CVs, although multiple files can be sent at the same time, CVS does not guarantee that one delivery is inseparable. that is to say, if we send three files at the same time, but an unexpected situation (such as a file conflict or a network disconnection) occurs in the second file ), at this time, the CVS system will send the first file change, but there is no second or third file. the files in the CVS system become inconsistent with our expectation!
Subversion delivery does not have the above problem. That is to say, not all of the results are sent to the system, but not to the system.
Better binary data processing
Although CVS is known to be able to process binary data (such as sample files and Microsoft Word files), it must be set by users, and users often forget it. in addition, CVs will take the initiative to change the file content, such as the column-end symbol and keyword expansion function, so that the file is often unable to be read only when the file needs to be restored to the past. furthermore, the file content difference algorithm of CVS is almost unable to process binary files, so that the files are stored,
A large amount of space is required.
Subversion provides two solutions to the preceding problems. first, it does not take the initiative to change the file content, unless the user adds such settings. furthermore, it uses the content difference algorithm suitable for text and binary data. In archive storage, both text and binary data have the same advantages. now, not only text data is suitable for version control systems, but binary data can also be easily put in.
Efficient branch and tag
We can mark the files that have been included in the version control system, that is, to associate them with an easy-to-remember text, which can be used in the future, restore these files to a specific State. however, CVS must add such a mark to each file. The more files, the longer it takes.
In the Subversion system, the tag is created as a directory copy, and the copy is created as a link. that is to say, no matter how many directories and archives are involved, the time it takes is fixed and will not take longer because of the increasing number of archives.
The most common drawback of CVS is that its branch functions are quite difficult to use. however, in practice, the branch function can increase the convenience for users. for example, you can isolate the program code by using the branch, so that developers can perform large-scale changes while maintaining the program. the Subversion Branch is also implemented based on copies of directories. It is easier to learn and use concepts.
Disadvantages of subversion
However, subversion does not have any disadvantages at all. It is still a starting system and still has some disadvantages.
We cannot obtain the exclusive edit permission for the Subversion file. this is because the Subversion work mode allows the workers to obtain work copies, edit them, and merge them at the time of delivery. however, sometimes we have to obtain the exclusive editing right of the file first, such as editing a graphic file. at this time, it is much easier for a single person to edit a file than to merge the files afterwards.
When a project starts to generate a branch, we often have to merge the changes of the current branch to the main development line. These changes are called merger points. subversion does not remember which merge points have been adopted by the branches. That is to say, after the merge changes, the merge changes again. When the branch develops in the future, when the change of the entire branch needs to be merged to the main development line, the system will not remember which changes have been adopted, but the merger will change, this will cause the same change to be merged twice. Later changes will almost certainly cause file conflicts and must be resolved by users. if the system can remember the merge points, the existing merge points do not need to be used, which can reduce the number of manual conflict resolution times.
In subversion, the version number is shared by the entire system. this means that, if a project file is changed and the version number is changed, the version number of all files will change accordingly. this is the most unacceptable for users who are transferred from CVS and takes some time to get used to it.
However, in this global version number, we cannot easily answer the question: what is the first version of a file? What changes have been made in the first two versions of the latest version? You know, sometimes we need something like this.
Although the Subversion architecture supports Unicode, the user interface still uses an English-only environment. There is still a long way to support the multi-language architecture.
The above briefly introduces the comparison between the advantages and disadvantages of subversion and CVS. although subversion has only started to develop for three years and has not yet entered version 1.0 this year, its convenience and functionality are above CVs. at present, there are still insufficient features that can be quickly added to the hands of active development teams. if you are interested, join the Subversion list now!
A brand new version control system, designed to replace CVs, provides better version management functions than CVs.
Start building with 50+ products and up to 12 months usage for Elastic Compute Service