Git learning Note 1---Basics

Source: Internet
Author: User
Tags version control system

1, the original local version control system     initially people used to copy the entire project with number processing to save different version information, but it is very bad, easy to confuse and error-prone to overwrite important files, in order to solve these problems, people developed a lot of local version control system, Most of the time, a simple database is used to record the differences in the historical updates of files. One of the more popular RSC, it works is to save the patch set on the hard disk, meaning the changes before and after the file revision, by viewing the patch, you can recalculate the various versions of the file content.  2. Centralized version control systemThe centralized versioning system (centralized version control systems, referred to as CVCS) has emerged from the problem of collaborative development of people on different development systems, such as CVS, subversion, etc., with a single Centrally managed server, it saves all revisions of the files, and the people who work together can connect to the server through their clients, reading or submitting the latest file updates. relative to the old-fashioned local control system, the advantage is that each co-workers to some extent know the overall progress of the project, know what others have done, and conducive to administrator centralized management, but the disadvantage is: the central server may be a single point of failure, as long as the server is down, all the clients can not submit updates, You must wait for the server to start again. If the disk where the hub database is located is damaged and does not have a proper backup, all data is lost, including the entire change history of the project.  3. Distributed version control systemthen came the distributed Versioning system (distributed version control systems, referred to as DVCS), such as Git, and so on, the client does not only extract the latest version of the file snapshot, but the code warehouse complete image preservation. This allows any server that works together to fail, and can then restore the local repository with any of the mirrors. Virtually every update is a full backup of the Code warehouse.      relatively centralized version control system, distributed version control system equivalent to each client can save a copy image, no central server unified management, the problem of any one client lost data can directly re-restore the other client copy of the data.  4. History of Gitdistributed version management system developed primarily by the founders of Linux to facilitate the management and maintenance of a large Linux kernel;features of the system:(1) Speed(2) Simple design(3) Strong support for non-linear development models, allowing thousands of parallel development branches(4) Fully distributed(5) ability to efficiently manage ultra-large projects like the Linux kernel 5. Git BasicsThe biggest difference between git and other version control systems is the way git treats data. Conceptually, most other systems store information in the form of file change lists. Such systems, such as CVS, consider the stored information as a basic set of files and a gradual accumulation of each file over time;                        Figure 1: For a typical storage stream, that is, each time the difference between each version is stored, not all the information of each updated version is stored, but the difference between the version of the Save information;Figure 2: Git's snapshot stream storage is more like taking data as a set of snapshots of a small file system, every time an update is committed, or when the state of a project is saved in Git, it is primarily a snapshot of all of the files to save the snapshot's index. To be efficient, if the file is not modified, Git does not re-store the file, but instead keeps a link to the previously stored file.  6, the advantages of Git(1) Nearly all operations are performed locallyA, most of the operation of Git only need to access local files and resources, because it is local operation, so the operation is very fast, do not need networking operations, networking is only in the need to update the project files, that you can continue to complete the project in the case of the network and upload updates when there are networks;B, the local will save all the historical version, view is very convenient, do not need to be processed by the remote server or from the remote server to pull back the old version of the file to be processed locally;(2) Git guarantees the integrity of the dataall data stored in git will calculate file checksum, use SHA-1 hash, hash function, to determine whether the relative file has been modified or corrupted;(3) Git typically only performs add data operationsgit simply adds data to the GIT database when it executes, making it difficult for git to perform any irreversible actions or to make it clear data in any way. As with other VCs, you might lose or mess with the changes when you do not commit updates, but once you commit a snapshot to git, it's hard to lose data again; 7. Three states of Git(1) submitted (committed): submitted indicates that the data has been stored securely in the local database;(2) modified (modified): modified to indicate that the file has been modified, but has not yet been saved in the data cry;(3) staged (staged): staged indicates that the current version of a modified file has been marked for inclusion in the next commit snapshot;

Git learning Note 1---Basics

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.