We have till now came across the understandings of Version Control System and its different features. The most popular version control system or VCS is GIT which is what this tutorial is all about. In this tutorial we will learn
- What is Git?
- Why to use Git?
What is Git?
Git is a Version Control System (VCS) and that to be Distributed VCS which was developed by Linus Torvalds, the same engineer who developed Linux Operating System. The situation which made him code Git is the actual definition of VCS. Linus Torvalds thought of a version control system for his operating system Linux because there did not match any available system to match his needs. This was much needed since Linux was open source and many developers wanted to contribute to Linux. A VCS would bring about a greater pace in the patch release and the development of this OS. All this made him develop GIT which is a version control system.
Why to use Git?
Since the development and release of Git, it has gained a huge popularity among the developers and being open source have incorporated many features. Today, a staggering number of projects use Git for version control, both commercial and personal. Let’s see why Git has become so popular by discussing its main features
- Performance: Git provides the best performance when it comes to version control systems. Committing, branching, merging all are optimized for a better performance than other systems.
- Security: Git handles your security with cryptographic method SHA-1. This algorithm manages your versions, files and directory securely so that your work remains only yours.
- Branching Model: Git has the most different branching model than the other VCS. Git branching model lets you have multiple local branches which are independent of each other. Having this also enables you to have friction-less context switching (switch back and forth to new commit, code and back), role-based code (a branch that always goes to production, another to testing etc) and disposable experimentation (try something out, if does not work, delete it without any loss of code).
- Staging Area: Git has an intermediate stage called as “index” or “staging area” where commits can be formatted and modified before completing the commit.
Do not worry about the term repository for now. We will discuss this in the upcoming sections. Just consider it as a folder where all your source code files are saved. So as you see, staging area is the intermediate stage where you can add files from your working directory. You do not need to worry about creating two logically same files knowing you will have to commit one so make changes in the other so that the working code remains intact. This used be done before Git.
- Distributed: Git is distributed in nature. Distributed means that the repository or the complete code base is mirrored onto the developers system so that he can work on it only.
- Open Source: This is a very important feature of any software present today. Being open source invites the developers from all over the world to contribute to the software and make it more and more powerful through features and additional plugins. This has led the Linux kernel be a software of about 15 million lines of code.
As for now we have understood that git is more powerful and leading the race in version control systems. After understanding what and why, it is better to understand how to use git.