Git (getting started)
Before we dive into what git is let’s roll back a little and understand what version control is. Version control is a system that records changes to a file over time so that you can recall specific versions later.
They are various types of version control systems namely;
- Local version control system
- Centralized version control system
- Distributed version control system
Local version control system
This is kind of the old school way of performing version control and sometimes considered many people’s method of choice which involves copying files into another directory (perhaps a time-stamped directory). this approach is very common because it is so simple, but is also incredibly error-prone.it is easy to forget which directory you’re in and accidentally write to the wrong file or copy over the file you don’t mean to. To deal with this issue, programmers long ago developed local VCSs that had a simple database that kept all the changes to files under revision control. One of the more popular VCS tools was a system called RCS (Revision Control System). you can learn more about it here.
Centralized version control system
Beyond the Local version control system, people needed to collaborate with developers on another system. To deal with this problem Centralized Version Control Systems (CVCS) was developed. Examples of such systems include CVS, Subversion, and Perforce. This system has a single server that contains all the versioned files, and a number of clients that check out files for that central place. This has been the standard for version control.
This setup offers many advantages, especially over local VCS. For example, everyone knows to a certain degree what everyone is doing on the project. However, this setup has some serious drawbacks. The most obvious is the single point of failure that a centralized system represents. This means if the server is down for two hours, during that time nobody can collaborate or save versioned changes to the server.
Distributed Version Control Systems (DVCSs)
Distributed Version Control Systems sets in to solve the problem faced by both the Local Version Control Systems and the Centralized Version Control Systems in that with the DVCSs, client or local computers don’t just check out the latest snapshot of the files, they fully mirror the repository or project, thus if a server dies, and these systems were collaborating via it, any of the client repositories can be copied back up to the server to restore it. Every clone is a full backup of all the data. Examples of such systems include Git, Mercurial, Bazaar, or Darcs.
A short history of git
As with many great things in life, Git began with a bit of creative destruction and fiery controversy.
The Linux kernel is an open-source software project of a fairly large scope. For most of the lifetime of the Linux kernel maintenance (1991 -2002), changes to the software were passed around as patches and archived files. In 2002, the Linux kernel project began using a proprietary DVCS called BitKeeper.
In 2005, the relationship between the community that developed the Linux kernel and the commercial company that developed BitKeeper broke down, and the tool’s free-of-charge status was revoked. This prompted the Linux development community (and in particular Linus Torvalds, the creator of Linux) to develop their own based on some of the lessons they learned while using BitKeeper. Some of the goals of the new system were as follows:
- speed
- Simple design
- Strong support for non-linear development (thousands of parallel branches)
- Fully distributed
- Able to handle large projects like the Linux kernel efficiently (speed and data size)
Since its birth in 2005, Git has evolved and matured to be easy to use and yet retain the initial qualities. it’s incredibly fast, it’s very efficient with a large project, and it has an incredible branching system for non-linear development.
Now lets get back to the main question.
What is Git?
Git is a distributed version control system that is simple to use and stores snapshots of the entire project, not differences. That is rather than storing or saving a list of changes like other Version Control Systems, Git basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot. Git thinks about its data more like a stream of snapshots.