In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
The main content of this article is to explain "what is git". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what git is.
What is Git?
Git is currently the most advanced distributed version control system in the world (none).
What are the characteristics of Git? To put it simply: the high-end atmosphere is high-grade!
So what is a version control system?
If you've ever written a long speech in Microsoft Word, you must have had this experience:
What if you want to delete a paragraph but are afraid that you will not be able to find it in the future? If there is a way, first save the current file as. " A new Word file, then change it, change it to a certain extent, and then "save as." A new file, which goes on like this, and your Word document ends up like this:
After a week, you want to find the deleted text, but you can't remember which file you saved before deletion, so you have to find it one by one, which is really troublesome.
Looking at a pile of messy documents, want to keep the latest one, and then delete the others, but also afraid that one day will be used, do not dare to delete, really depressed.
To make matters worse, some parts need to be filled out by your financial colleague, so you Copy the document to her on a USB drive (or send her a copy via Email), and then you continue to modify the Word file. A day later, your colleague will send you the Word file. At this point, you have to think about what changes you made between the time you sent it to her and the time you received her file. It's really difficult to merge your changes with hers.
So you think that if there is a software that can not only automatically record every file change for me, but also allow colleagues to collaborate to edit it, so that you don't have to manage a bunch of similar files yourself, and you don't have to pass them around. If you want to see a change, you only need to take a peek at it in the software. Isn't that convenient?
This software should be used like this, recording every change to the file:
Version
User
Description
Date
one
Zhang San
Removed software terms of service 5
7/12 10:38
two
Zhang San
Increased the limit on the number of people in License
7/12 18:09
three
Li Si
The finance department adjusted the contract amount.
7/13 9:51
four
Zhang San
Extended free upgrade cycle
7/14 15:17
In this way, you end the prehistoric era of manually managing multiple "versions" and enter the 20th century of version control.
As many people know, Linus created the open source Linux in 1991. Since then, the Linux system has evolved into the largest server system software.
Although Linus created Linux, the growth of Linux depends on the participation of enthusiastic volunteers from all over the world. With so many people writing code for Linux around the world, how is the Linux code managed?
The truth is, before 2002, volunteers around the world sent source code files to Linus via diff, and then Linus himself merged the code manually!
You might wonder, why doesn't Linus put Linux code in the version control system? Aren't there free version control systems like CVS and SVN? Because Linus is firmly opposed to CVS and SVN, these centralized version control systems are not only slow, but also must be connected to the Internet before they can be used. There are some commercial version control systems that are easier to use than CVS and SVN, but they are paid for and are not in line with the open source spirit of Linux.
However, in 2002, the Linux system had been developed for ten years, and the size of the code base made it difficult for Linus to continue to manage it manually, and the brothers in the community expressed strong dissatisfaction with this way, so Linus chose a commercial version control system, BitKeeper,BitKeeper 's owner, BitMover, in a humanitarian spirit, authorized the Linux community to use the version control system free of charge.
The good situation of stability and unity was broken in 2005, due to the gathering of cattle people in the Linux community, which inevitably contaminated the habits of some Liangshan heroes. Andrew, who developed Samba, tried to crack BitKeeper's protocol (and he wasn't the only one), and was discovered by BitMover (good monitoring work! ), so BitMover got angry and wanted to take back the free right to use the Linux community.
Linus can apologize to BitMover and promise to discipline the brothers strictly in the future. Well, this is impossible. The actual situation is as follows:
Linus spent two weeks writing a distributed version control system in C #, which is called Git! Within a month, the source code of the Linux system has been managed by Git! How do you define a cow? You can feel it.
Git quickly became the most popular distributed version control system, especially in 2008, when the GitHub website was launched, which provided free Git storage for open source projects, and numerous open source projects began to migrate to GitHub, including jQuery,PHP,Ruby, and so on.
History is so accidental that if BitMover hadn't threatened the Linux community, we might not have a free and super-useful Git now.
CVS and SVN, which Linus has always hated, are centralized version control systems, while Git is a distributed version control system. What's the difference between centralized and distributed version control systems?
First of all, let's talk about the centralized version control system, where the version library is centrally stored on the central server, and when we work, we use our own computers, so we have to get the latest version from the central server first, and then start working and finish the work. Then push your work to the central server. The central server is like a library. If you want to change a book, you must first borrow it from the library, then go home to change it yourself, and then put it back in the library.
The biggest problem with the centralized version control system is that it must be connected to the Internet in order to work. If it is all right in the local area network, the bandwidth is large enough and the speed is fast enough, but if the network speed is slow on the Internet, it may take 5 minutes to submit a 10m file, which does not suffocate people.
What is the difference between a distributed version control system and a centralized version control system? First of all, the distributed version control system does not have a "central server" at all, and everyone has a complete version library on their computer, so that when you work, you do not need to connect to the Internet, because the version library is on your own computer. Since everyone has a complete version library on the computer, how can multiple people cooperate? For example, if you change file An on your computer, and your colleague changes file An on his computer, you just need to push your changes to each other and you can see each other's changes.
Compared with the centralized version control system, the security of the distributed version control system is much higher, because everyone has a complete version library in the computer, it doesn't matter if one person's computer is broken, just copy one from someone else. If something goes wrong with the central server of the centralized version control system, everyone will not be able to work.
When actually using a distributed version control system, it is rare to push changes to the version library on the computers between the two people, because maybe you two are not in the same local area network and the two computers cannot access each other, or maybe your colleague is sick today and his computer is not turned on at all. Therefore, the distributed version control system usually has a computer that acts as a "central server", but the function of this server is only to facilitate the "exchange" of everyone's changes, and everyone will do the same without it. It's just that it's not convenient to exchange changes.
Of course, the advantage of Git is not only that you don't have to connect to the Internet, but we will also see that Git's extremely powerful branch management leaves SVN and others far behind.
As the earliest open source and free centralized version control system, CVS is still used by many people. Due to problems in the design of CVS itself, the submission is incomplete and the version library is inexplicably damaged. SVN, which is also open source and free, fixes some stability problems with CVS and is currently the most widely used centralized version library control system.
In addition to free, there are fee-based centralized version control systems, such as IBM's ClearCase (formerly owned by Rational, acquired by IBM), which is characterized by installation larger than Windows, running slower than snails, and being able to use ClearCase is generally one of the world's top 500, they have a common feature is deep pockets, or people stupid money.
Microsoft itself has a centralized version control system called VSS, which is integrated into Visual Studio. Even Microsoft is embarrassed to use it because of its anti-human design.
In addition to Git and BitKeeper, which promoted the birth of Git, there are also Mercurial and Bazaar similar to Git in distributed version control system. These distributed version control systems have their own characteristics, but the fastest, simplest, and most popular one is still Git!
At this point, I believe you have a deeper understanding of "what git is", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.