Version control tool

xiaoxiao2021-03-06  23

Version Control Tools Version Control is a tool development, an essential tool, especially in multiplayer team, suitable version control tools can improve development efficiency, eliminate many code versions. This article first lists the problems that may encounter when there is no version control tool, and then introduces the mainstream version control tool, which is later introduced to the history, function, concept of the version control tool CVS preferred by the Java developer; finally in Eclipse CVS In the environment, a complete process used by CVS is an example, describing how to use CVS tools correctly. Why use version control tools? If there is no assistance to the version control tool, we often encounter some problems in the development: First, the code management is confusing. If you are adding or deleting a file, you are hard to find. There is no way to trace the modification of the file code. There is even file loss, or the new version code is unintentionally covered by companions. Second, solve the difficulty of conflict between code. When everyone modifies a public file, solving the code conflict is a very headache. The most primitive approach is to manually open conflict files, compare progressive, and then paste the copy. The more advanced practice is to use the file comparison tool, but still can't save complicated manual operations, unclear, and even introduce new bugs. Third, the deep bug is introduced during the code integration. For example, developer A wrote a public function, and B felt that it can be reused; later A further modified this public function, adding new logic, and this change is B unwanted. Or A found that this public function is not enough, and has made a function, but B is not in time notification. These are all hidden dangers for deep bugs. Fourth, the owner of the code cannot be permissible. The code is completely exposed to all developers, anyone can increase, delete, change operation, and cannot specify a clear person responsible for the code. Especially the development of products, this is extremely dangerous. 5. The different versions of the project have been released. Especially for the development of products, you will be released frequently, then there is no effective management of product version tools, everything will become very difficult. The above is just a number of issues that may have no version control system, especially for large projects and differently developed a suitable version of the control tool, which can effectively solve all kinds of problems caused by different code versions, let our Developers can spend more effort to develop. Instead of each time spent a lot of time for code integration and solutions to the different issues.

Mainstream version control tool introduces now, there are many excellent version control tools for us to choose, the following is a simple introduction to the five mainstream version control tools. StarTeam is a software that collects version control, build management (build management) and defect tracking system, and has a powerful graphical interface, easy to learn; but management is complex, maintenance difficulties, does not support parallel development. Borland was acquired by Borland at the end of 2002. PVCS Version Manager is an integral part of the USMANT software configuration management tool PVCS family that enables source code, executable file, version of the application file, graphics file, and document version management; it can safely support software parallel development, Volumely control management of multiple software versions. ClearCase (CC) is part of ROSE components, currently the most catalog management tools, mainly used in complex product issuance, distributed teamwork, parallel development and maintenance tasks. You can control Word, Excel, PowerPoint, Visio, and other file formats, you can define a type to identify yourself for unformable formats. Visual SourceSafe (VSS) is easy to use, convenient, highly integrated with the Windows operating system and Microsoft development tools. CVS (Concurrent Versions System) is a concurrent version of the source code, which is currently the most popular source code version management solution for software developers. It can be used in a variety of platforms, including Linux, UNIX, and Windows NT / 2000 / XP, etc. The first three is a heavyweight commercial version control tool, which is more suitable for huge teams and projects, and the price is not. Visual SourceSafe is Microsoft's product, of course, can only be used in Windows platforms and seamlessly integrate with Microsoft development tools. CVS is free open source, and almost all open source projects are used to manage version of CVS, undoubtedly, it is our Java developer optimal choice. CVS history, function, basic concept introduction History CVS was born in 1986, which appeared as a group of shell scripts; in March 1989, Brian Berlinor was redesigned with C language and wrote CVS code; 1993, Jim, Jim Kingdon eventually designs CVS to network-based platforms, developers to get program source code from Internet anywhere. Up to now, the latest version is 1.12.11 issued on December 13, 2004. Function introduction 1, code unified management, save history of all code file changes. Centrally managed the code, you can easily view new or deleted files to track all code changes traces. You can recover from any of the previous historical versions. And avoid the deep bugs from which the version is introduced. Second, a perfect conflict solution that can easily resolve document conflicts without the need to compare tools and manual paste replication with other files. Third, the management of code authority. You can set different permissions for different users. You can set access to the user's password, read-only, modified, and through the script in the CVS root directory, provide the corresponding functional expansion interface, which can not only complete fine permission control, but also complete more personalized features. Fourth, support convenient version release and branch function.

Basic Concept Sources (Repository) CVS resource depot stores all version control file COPY, usually not allowed to access directly, only pass the CVS command, get a local COPY, after CHECK IN (COMMIT) return repository . The repository is usually separated from the work directory. CVS access the repository in a variety of ways. Each method has different directory representations. Version (Revision) Each version of each file is different, shaped like 1.1, 1.2.1, general 1.1 is the first revision of the file, and one of the back will automatically increase the rightmost integer, such as 1.2, 1.3, 1.4 ... sometimes 1.3.2.2, after seeing. Revision always even numbers. Under normal circumstances, the revision is performed as a number inside the CVS, and the tag can log user's specific information. Label (TAG) with symbolized representation method flag file specific Revision information. Usually do not need to be tag for a file, but a TAG is simultaneously for all files, and the user can submit or Checkout only to the specific TAG file. Another role is to indicate which files and which version it is available during the release software; each file can be included in a TAG. If you name an existing Tag default will not overwrite the original; branch (BRANCH) does not have any effect on additional BRANCH when the user modifies a BRANCH. The two versions can be combined by the merge method in appropriate time; Branch is always plus an even integer after the current revision (starting from 2, the end), so Branch is always an odd number, such as 1.2, back Branch For 1.2.2, Revision may be 1.2.2.1, 1.2.2.2, ... conflict (Conflct) is completely a conflict of plain text, does not contain logical contradictions. Generally a document, A made changes, b has been changed before A, so that in the end, who will conflict, need to handle the conflict and then submit. CVS and Eclipse integration development have introduced the history, function, instructions of CVS. Below we will use the CVS tools built in the most popular Java IDE Eclipse to introduce the correct use of CVS in the actual environment in a complete development process. About the installation of the CVS system is not the content of this article, you can get the installation information from the link to the link. Common CVS Control Command Check Out Remove the source file from the CVS source warehouse, the default version is the latest version, you can also select the specified version. Before you change the source code, you need the latest version of CHECK OUT, and then the source code is modified. In the specified directory, all files are Read-Write. Check in (check) Add the source code into the CVS source warehouse, each of the files that add the file in the Code Base is 1.1. After each modify the file again, the version of this file is incremented to 1.2, 1.3. ....... After modification of the source code, you need Check IN to submit the latest version of the source code. Synchronize with repository (synchronized with resource library, referred to as synchronization) makes local changes to repository, which lists different files between local and resource libraries. Add to Version Control Adds new files into version control.

Add to .cvsignore sets the file to version control so that changes in the file or directory are not visible in CVS, even if synchronization cannot be found. CVS correctly uses steps, synchronization (Synchronize) is the latest changes to the last out of the next to the server after synchronizing the local change with the server. This is very useful, especially agile development, emphasizing the collective ownership code. With synchronous features, you can grasp the code of the project, which can easily track any changes to the public module code. Specific operation: In the resource perspection (RESOURCE PERSPECTIVE) or Java View (Java perspective), select the directory you want to synchronize, click Right click to select "Synchronize with repository", which will then display the synchronization view. As shown below: (Figure 1, CVS synchronization view) After synchronization, it has four mode options, see the green box box in the picture above. From the right to: incoming mode: indicates that the modification is from the server, corresponds to the update (UPDATE). Outgoing mode: Represents the modification comes from the local, corresponding submit (commit) operation. INCOMING / OUTGOING MODE: Local and server modifications are displayed in this mode (MODE). Conflicts Mode: Displays conflict files for local and server modifications. Second, update (update) is relatively simple, select incoming mode, select the file to update to update, right click to select the Update action. Third, resolve conflicts and merge (Solve Conflct and Merge) If conflict files, conflict files cannot be updated. You must first resolve conflict restarts. Select the conflict file, then right click to select "Open in Compare Editor" and open the file with the comparison tool. As shown below: (Figure 2, CVS comparator view)

转载请注明原文地址:https://www.9cbs.com/read-65149.html

New Post(0)