What is Git?
Git is a distributed version control system. Let's break it down:
- version control system (VCS) (a.k.a. revision control system):
A system that tracks versions of files (often source code) in a database, known as the repository. This allows us to go back to any previous version, compare versions, analyze which version introduced a given problem, and more. - distributed: Rather than storing the repository (i.e., the database of versions) on some central server and accessing it via the network, we work with a local copy of the repository. The local repository is only synchronized with other repositories on demand.
The distributed nature of Git allows us to work locally, even offline if necessary. You can work while on the train and synchronize the repository once you're back online. When working on an open source project, you can create a complete copy of the repository and make your own changes, whether you intend to ever sync them back to the original repository or keep developing your own fork of the project.
Why use version control?
Imagine you are playing a video game where you can save your progress at any point. If you die in the game, you need to reload your last save. How much progress you lose depends on how recently you last saved.
If you mess up your last save (like saving in a situation where you are doomed to die every time), you will be glad to have access to your previous saves as well.
Git keeps versions of files so that we can retrieve them later, even if just to make sure we don't lose too much progress if something goes wrong. Who hasn't had a "Presentation_v5_final.pptx" on their USB drive at some point? We can also use it to share those files with our colleagues, compare them with older versions, and more.
The History of Git
Git was originally created in 2005 by Linus Torvalds, who also initially created the Linux kernel, because the free license of the VCS previously used for Linux kernel development was revoked. Although mainly credited to Linus Torvalds, he only maintained Git for a few months, and the main contributor and maintainer has been Junio Hamano[1][2] for many years.
Note that, while its creator jokingly gave multiple reasons for its name (a British slang word similar to "idiot"), the official spelling is Git, not GIT.
A similar VCS, Mercurial, has had a similar history, but Git became significantly more popular.
Alternatives to Git
Git is sometimes used synonymously with version control due its popularity, but it is not the only VCS by far. Historic VCSs include CVS, BitKeeper, Bazaar, and Subversion. Modern Git alternatives include Mercurial, Breezy, and Jujutsu, some of which are arguably more modern alternatives and have support for Git's file formats, but didn't (yet) gain widespread adoption in the industry. There are some proprietary VCSs with paid licenses and special use cases, and some that are used only internally in some bigger companies due to their special requirements.
In short, there are many VCSs, and Git is not really that special, but the best reason to use Git is probably its already widespread adoption rather than it being better than the alternatives.