Git, A dream machine time (a)

Recently the company projects using Git as a version control tools in this learning experience will be summarized as follows. The article was intended to try to use the simplest and most popular way to describe my eyes Git, git does not involve complicated instructions, do not have scientific significance, only for entertainment, welcome Paizhuan.

 

      1, Git what's the use?

      Project management, there are many difficulties are inevitable, such as how to ensure the traceability of file operations? How to constantly upgrade iteration of the product management? Teamwork should be how to efficiently coordinate the operation? ... especially with the growing size of the project and system, these difficulties will become a snowball, so that managers miserable. The Git as a very good version control tool that can solve the problem elegantly, whether management code, or manage other sectors of the media information is very useful. 

      

      2, have to say Snapshot

       Did not intend to write a snapshot, but considering talked about Git It is not open around the concept of interim snapshot of the content plus it ...

      Snapshot (the Snapshot) is a form of stored documents, it is the concept relative to the other form of storage - copy exists. Everyday life we ​​often use the copy function, such as right-click copy and paste, you can put the contents of a folder in a laundry list of copy to another folder on a different disk physical address, this time kept the two copies of the same content.

      The snapshot in Git more like a time file recording state , just like the photo as a snapshot reflected a " View " function. So the question becomes, now I just want to quickly find the state at a time, then we can take a more lightweight way to achieve (copies can also be achieved, but there is no doubt occupy space and time) , so the thought of the great God who adopt a shared approach to solve the problem. (Git snapshot on an authoritative interpretation is not found, entirely based on personal understanding, for the sake of rigor, choose to ignore ...)

      Analogy: You've got three cards 7,8,9, and touched a 9, this time if you let show his cards before you, you will show 7,8,9; allow you to show hand in the latest cards, you will show 7,8,9,9; let show you a pair, you only need to show to 9,9; reverse allow you to show you the rest of the cards picked up again, display 9, 9,8,7; allow you to show all the clubs, you probably will demonstrate other combinations. In short, your hands start to finish only four cards, but you can show a different state through several permutations, if we put them in a logical order corresponding to the state record, you can quickly retrieve these states at any time .

 

       3, Git Why good?

      Version control tools are divided into two categories centralized and distributed. As a distributed version control tools, Git there are many traditional centralized with having no advantages:

  • Snapshots recorded directly rather than differences

       SVN as the representative of centralized management tool is used to store incremental way, namely with respect to the last modification, I just recorded my current situation changes; but Git is no matter what you are before you change time I first recorded the results. The advantage is obvious, it makes modifications are submitted every time the entire project complete record , we can find any version of a project when all the documents are in what state, this independence so that we do not need to know the or once again in the end last time we submitted something, changed something.

  • Almost all operations are performed locally

       Git introduced the concept of local repository, you just need to execute git clone command, it would have been exactly the same as a working paper and remote repository (Central) on your computer. So, as long as you do not interact with other collaborators, totally do not need networking, but also to carry out their tasks.

       This is one of the charms distributed - to achieve decentralization .

  • You can ensure data integrity

       Git introduced checksum concept, in order to ensure data integrity. What is the checksum it? In fact, a bit like a file for feature extraction, yielding the mapping relationship . For example, extraction of your fingerprint, then this is a fingerprint check and every punch work, check this one is not your time to find fingerprints on the line. Is not very insurance?

  • Generally only add data

      The first has been described in the local repository has been saved each version of the snapshot, so we want to see any historical version, you can easily jump ( Checkout ) in the past, without the need for deletion. I have a time machine can arbitrarily shuttle, yesterday also unique day, why you want to delete it yesterday? Since we almost never delete operation, then you can maximize avoid all kinds of errors.

Guess you like

Origin www.cnblogs.com/mrpour/p/11222455.html