DEV Community

Cover image for What is Git?
5 Mins Learn
5 Mins Learn

Posted on • Updated on • Originally published at 5minslearn.Medium

What is Git?

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

What is Version Control System?

Version control, also known as source control, is the practice of tracking and managing changes to software code that help software teams manage changes to source code over time.

What is Distributed Version Control System?

To understand this term clearly, we need to know about

  • Local Version Control System
  • Centralized Version Control System

Local Version Control Systems

  1. Many people’s version-control method of choice is to copy files into another directory (perhaps a time-stamped directory)
  2. This approach is very common because it is so simple, but it is also incredibly error prone

Local Version Control Systems

Centralized Version Control Systems

  1. Centralized Version Control Systems (CVCSs) such as CVS, Subversion, and Perforce, have a single server that contains all the versioned files, and a number of clients that check out files from that central place
  2. This has been the standard for version control many years

Advantage of this system is everyone knows to a certain degree what everyone else on the project is doing

Disadvantages of this system are,

  1. If that server goes down for an hour, then during that hour nobody can collaborate at all or save versioned changes to anything they’re working on
  2. If the hard disk the central database is on becomes corrupted, and proper backups haven’t been kept, you lose absolutely everything — the entire history of the project except whatever single snapshots people happen to have on their local machines

Distributed Version Control Systems

  1. Distributed Version Control Systems (DVCSs) such as Git, Mercurial, Bazaar or Darc, clients don’t just check out the latest snapshot of the files, instead they fully mirror the repository
  2. Thus if any 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
  3. Every clone is really a full backup of all the data

Distributed Version Control Systems

The primary advantage of this system is that they deal pretty well with having several remote repositories they can work with, so you can collaborate with different groups of people in different ways simultaneously within the same project

This allows you to set up several types of workflows that aren’t possible, such as hierarchical models

Goals of Git

  1. Speed
  2. Simple design
  3. Strong support for non-linear development (thousands of parallel branches)
  4. Fully distributed
  5. Able to handle large projects like the Linux kernel efficiently (speed and data size)

Since its birth in 2005,

  1. Git has evolved and matured to be easy to use and yet retain these initial qualities
  2. It’s incredibly fast, very efficient with large projects, and it has an incredible branching system for non-linear development

References

  1. Pro Git Book by Scott Chacon and Ben Straub
  2. Git Official Documentation https://git-scm.com/
  3. Atlassian Git Documentation https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud

Hope you enjoyed reading this article. Hit the like 👍 if you like this article. Follow to read more such interesting articles on fundamentals.

Subscribe to our newsletter to receive more such insightful articles that get delivered straight to your inbox.

You can follow me on LinkedIn, Instagram, Twitter and Medium

Top comments (0)