Git – Part 1 – The story
What is a version controlled system and what is Git?
to the code over time in a special database called repository. Advantages of using a VCS during software development include:
- We can easily check our project history to see who has made what changes and can easily revert to previous versions if required.
- Without a version controlled system, we have to store copies of our software versions in various folders and overtime it becomes unmanageable and unscalable as collaboration with other developers and teams becomes harder.
Version controlled systems (VCS) falls into two categories: Centralized and Distributed. In a centralized VCS, all team members connect to a central server to get the latest copy of the code and to share their changes with each other e.g., Subversion and Microsoft Team Foundation Server. The problem with this centralized architecture is the single point of failure. If the server goes down, the teams cannot collaborate and save snapshots of their project.
In a distributed VCS, every team member has a copy of the project with its history on their machine. So, we can save snapshots of our projects locally on our machines. Even if the central server is offline, we can still synchronise our work directly with others e.g., Git and Mercurial.
Git is the most popular version controlled system in the world. It is fast, open source, scalable, free and has superfast branching & merging capabilities. Git commands can be executed via command line, modern IDEs (Integrated Development Environments like VS Code etc. that support version control options) and various GUI (Guided User Interface) tools.
To install Git on your machine, go to git-scm.com/downloads and select the option based on your operating system.
On Windows operating system, installing Git gives an application called Git BASH (Born Against Shell) which is basically a command prompt window emulating a UNIX or Linux environments. You can use this to type your git commands or can use the command prompt or powershell. If you are using powershell, then you can also download an additional add-in Posh-Git to enhance your git experience (read here).