What is git and why is it so popular?
Git is the most powerful version control system in the world
What does version control system do? It records changes to our code over time in a special database called repository
We can look our project history and see who has made changes (WHEN and WHAT) and if it has screw things up, we can easily revert our project back to an earlier state.
Without a version control system we will constantly need copies our project in various (revision) folders which is very slow process and does not scale at all. Especially when there are multiple people working on the same project.
So in a nutshell with version control system we can track our project history and work together.
Version control system falls in two categories, i.e. centralized and distributed.
In a centralized system, all the team member connect to a central server to get the latest copy of the code and to share the changes with others. Subversion and Microsoft Team Foundation Sever are examples of centralized version control system.
The problem with centralized version control system is single point of failure. If the server goes offline we cannot collaborate or save snapshots of our project. So we have to wait until the server comes back online.
In distributed version control systems we don't have these problems. Every team member has a copy of the project in the history of their machine. So we can save snapshots of our project locally on our machine. If the server is offline we can still sync our work directly with others.
Git and mercurial are examples of distributed version control systems.
- Open Source
- Super Fast
Operations like merging and branching are painful in other version control systems.
Git is everywhere. More than 90% of the software projects use git around the world.