This is the 13th day of my participation in the August More Text Challenge.More challenges in August
Introduction of SVN and Git, differences, advantages and disadvantages, scope of application summary
SVN SVN, short for Subversion, is an open source version control system that supports most common operating systems. As an open source version control system,Subversion manages data that changes over time. These data are stored in a central repository. The archive works much like a regular file server, except that it remembers every change to a file. This way you can restore the file to an old version or browse the history of the file. Subversion is a general-purpose system that can be used to manage any type of file, including program source code.
The working process
The workflow of centralized management is shown below:
At the heart of centralized code management is the server, from which all developers must retrieve code before starting the day, develop it, resolve conflicts, and commit. All version information is stored on the server. Without the server, the developer basically can’t work. Start your day:
1. Download the latest code of the project team from the server. Go into your own branch, work on it, and commit code to your own branch of the server every hour (many people have this habit). Sometimes you need to do this because you want to go back to the last hour, or see what code you changed in the last hour). 3. When it is time to go off work, merge your branch into the main branch of the server, and reflect the work of the day to the server.
GIT (Distributed version control System) is a free, open source, distributed version control system for agile and efficient handling of any project, small or large. GIT is an open source, distributed version control system for efficient and fast handling of project version management, from the very small to very large. Git is an open source version control software developed by Linus Torvalds to help manage Linux kernel development. The biggest difference between distributed and centralized is that developers can commit locally. Each developer can copy a complete Git repository on the local machine by git Clone.
The working process
Below is a classic Git development process.
Git has the following functions: 1. Clone a complete Git repository (including code and version information) from a server to a standalone server. 2. Create branches and modify code on your own machine for different development purposes. Commit code on a branch you created on a single machine. 4. Merge branches on a single machine. 5. Fetch the latest code from the server and merge it with your main branch. 6. Generate patches and send them to the lead developers. 7. Looking at the lead developer’s feedback, if the lead developer sees a conflict between two normal developers (a conflict that they can work together to resolve), he will ask them to resolve the conflict first and then one of them will submit it. If the lead developer can work it out on his own, or if there are no conflicts, pass. 8, the general method of conflict resolution between developers, developers can use the pull command to resolve the conflict, after resolving the conflict to submit patches to the main developer. From a master developer’s point of view (assuming the master developer doesn’t have to develop code), Git has the following functions: 1. Check email or other means to see the status of submissions from the average developer. 2. Patch and resolve conflicts (either by yourself or by asking developers to resolve them and then resubmit them, or if it’s an open source project, decide which patches work and which ones don’t). 3. Submit the results to a public server and notify all developers.
The difference between
1. The SVN is a centralized version control system, which has an imprecise analogy :SVN = version control + backup server. The SVN acts like an archive repository, supporting parallel reading and writing of files and versioning of codes, including fetching, importing, updating, branching, renaming, restoring, and merging.
Git is a distributed version control system with the following commands: Clone, pull,push, branch,merge,push,rebase. Git specializes in versioning program code.
2. Like SVN, GIT has its own centralized repository or server. However, GIT tends to be used in a distributed mode, where each developer chect out code from a central repository/server and clone his own repository on his own machine. It’s safe to say that if you’re stuck somewhere with no Internet connection, like on a plane, in a basement, in an elevator, etc., you’ll still be able to submit documents, view history releases, create project branches, etc. This may not seem like much use to some people, but when you’re suddenly in an environment without an Internet connection, this will solve your problems.
3.GIT stores the content as metadata, while SVN stores the content as files. All resource control systems hide the meta information of files in folders like. If you compare the size of the.git directory with the size of the.SVN directory, there is a huge difference. Because the.git directory is a clone repository on your machine, it has everything from the central repository, such as tags, branches, version records, etc.
4. Branch is nothing special in SVN, just another directory in the repository. If you want to know if a branch has been merged, you need to manually run a command like SVN propget SVN :mergeinfo to confirm that the code has been merged. Working with GIT’s branches, however, is fairly simple and fun. You can quickly switch between branches from the same working directory. You can easily find branches that have not been merged, and you can merge these files easily and quickly.
5.GIT does not have a global version number, while SVN has by far the biggest feature GIT lacks compared to SVN. As you know, the version number of SVN is actually a snapshot of the source code at any given time. I think it’s the biggest evolution from CVS to SVN. Because GIT and SVN are conceptually different, I don’t know what features in GIT correspond to them. If you have any clues, please share them in the comments.
6.GIT has better content integrity than SVN: GIT uses the SHA-1 hash algorithm for content storage. This ensures the integrity of the code content and reduces damage to the repository in the event of disk failures and network problems.
The advantages and disadvantages
Advantages and disadvantages of SVN The SVN supports Chinese well, is easy to operate and easy to use, and is easily accessible to artists, product personnel, testers, and implementation personnel. Unified interface, perfect function, easy to operate.
Git’s advantages and disadvantages The source code of the program is differentiated version management, the code base takes up very little space. Easy to branch code management. Does not support Chinese, graphical interface support poor, difficult to use. Not easy to popularize.
Scope of application
1) Different applicable objects. Git is for developers involved in open source projects. They care more about efficiency than ease of use because of their high level. SVN, on the other hand, is suitable for the average corporate development team. Easier to use.
2) Different occasions. Git is suitable for the development of a single project with multiple development roles over the Internet, while SVN is suitable for the development of multiple parallel projects coordinated by project managers within an enterprise.
3) Different rights management policies. Git does not have strict permission management control, as long as you have an account, you can export, import code, and even perform rollback operations. The SVN has strict permission management. You can control the permission of a subdirectory by group or individual. Distinguish read and write permissions. More strictly, rollback operations are not supported. Make sure your code is always traceable.
4) The scope of use of branches is different. In Git, you can only branch for an entire repository, and once removed, you cannot recover. On SVN, Branch can work for any subdirectory and is essentially a copy operation. So, you can create a lot of hierarchical branches, remove them when you don’t need them, and simply checkout the old SVN version when you need it later.
5) Based on the third point, Git is suitable for pure software projects, typically some open source projects, such as Linux kernel, Busybox, etc. SVN, on the other hand, is good at multi-project management. For example, you can have one mobile project BSP/design document/file system/application/automated build script in one SVN repository, or five mobile project file systems in one SVN repository. N (number of projects) x M (number of components) repositories must be set up in Git. The SVN requires a maximum of N or m devices.
6)Git uses a 128-bit ID as the version number, and you need to specify which branch you are checking out, while SVN uses an increasing serial number as the globally unique version number. You can use Gittag to create literal aliases, but that’s only for special versions.
7) Traceability. The typical development process of Git is: branch establishment, development, submission to the local master, and branch deletion. The consequence of this is that the details of previous modifications will be lost. When you do the same with SVN, no details are lost. Here’s an interesting link that shows how git typically works: (Master at the core, constantly creating new branches, removing old ones):
8) Partial update and partial restore. The SVN creates a. SVN folder in each folder for management, so local update or restoration can be easily implemented. If you only want to update certain parts, SVN will do just fine. Git can also be restored through historical versions, but it is not easy to achieve a local restore.
The SVN is a centralized version control system
This approach brings many benefits, especially when compared to the older native VCS. Now, everyone can see to some extent what everyone else on the project is doing. Administrators can easily control the permissions of each developer. Copy the codeCopy the code
There are two sides to a story, good and bad. The most obvious drawback of this approach is the single point of failure of the central server. If it’s down for an hour, no one can commit updates, restore, compare, etc., and no one can work together during that hour. There is also the risk of data loss if disks on the central server fail and are not backed up or not backed up quickly enough. The worst case scenario is to completely lose all historical changes for the entire project, with the exception of some snapshot data extracted by the client, but this is still a problem, you can’t guarantee that all the data has been extracted. Subversion principle only cares about specific differences in file contents. Keep track of which files are updated each time, and what is updated in which rows.
The characteristics of Subversion are summarized as follows:
1. Each repository has a unique URL (official address) from which every user gets code and data;
2. To obtain code updates, only connect to this unique version library, synchronization to obtain the latest data;
3. The submission must have a network connection (non-local version library);
4. Submission requires authorization. If there is no write permission, the submission fails.
5. Submission is not always successful. If someone else submits before you, it will prompt “change based on outdated version, update first before submitting”… And so on;
Conflict resolution is a race for speed: quick, submit first and get away with nothing; Slow hands, after submission, may run into trouble with conflict resolution.
Git is a distributed version control system
Since its inception in 2005, Git has matured to a level of ease of use while remaining true to its original goals. It's fast, perfect for managing large projects, and has an incredibly non-linear branch management system that can handle complex project development needs. Copy the codeCopy the code
Unlike SVN, Git records a version history and only cares if the overall file data has changed. Git does not store data that changes the contents of a file. In practice, Git is more like taking snapshots of files that have changed and recording them in a tiny file system. Each time an update is committed, it looks through the fingerprint information of all the files and takes a snapshot of the file, then saves an index pointing to that snapshot. To improve performance, Git doesn’t save the file again if it hasn’t changed. Instead, it only makes a connection to the last saved snapshot.
In a nutshell, Git has the following features:
1. All clone repositories in Git are equal. You can create your own library from a clone of any library, and your library can be made available as a source to others if you wish.
2. Every Git extract is actually a complete backup of the repository. Submissions are done entirely locally, you don’t have to be authorized, your repository is in your own hands, and submissions are always successful.
3. Even changes based on the old version can be successfully committed, and a new branch can be created based on the old version.
4.Git commits will not be interrupted until you are completely satisfied with your work, PUSH to someone else or PULL your repository, merge will occur during the PULL and PUSH process, and conflicts that cannot be resolved automatically will prompt you to do it manually.
5. Conflict resolution is no longer a commit contest like SVN, but a merge and conflict resolution when needed.
In short, SVN is a better choice for the company’s development team when it comes to project development management. The team members work together to maintain the company’s central version. If it’s an open source project, Git is more suitable, and everyone can maintain their own version, supported by the Github open source community.
Which is more suitable for project management, SVN or Git? SVN is more suitable for project management, Git is only suitable for code management. The members of a RESEARCH and development team normally include: requirements analysis, design, artists, programmers, testing, implementation, operation and maintenance. Each member has output in the work, including documents, design code, program code, which need to be managed centrally according to the project. The SVN can clearly manage project groups by category, ensuring an orderly and efficient management.
Reference and reproduced from the bole online: marko39:jingyan.baidu.com/article/676 blog.jobbole.com/31444/ baidu wikipedia: baike.baidu.com… Code fan net: www.mamicode.com/info-detail… Csdn:blog.csdn.net/mine_song/a…