This is the first part of series of articles where I will be teaching what I've learnt so far following Mosh Hammedani's course on how to use Git
What is Git?
GIT stands for Global Information Tracker. According to Wikipedia , Git is a software for tracking changes in any set of files, usually for coordinating work among programmers collaboratively developing source code during development.
Git is the most popular version Version control system in the world.
What is a Version Control System
A version control system (VCS) is a software the makes it easy for developers in a team to efficiently communicate and manage(track) all changes that have been made to the source code along with information like the author of the changes and what type of change was made.
It records changes made to our codebase over time in a special database called Repository. Git being a version control system allows us to track the history of our code and also work together with other developers.
Version control system falls into two categories.
- Centralized
- Distributed
Centralized
In a centralized system, all team members connect to a centralized server to get the latest copy of a code and to share their changes with others. e.g Subversion, Microsoft Team Foundation Server.
The problem with this Architecture is a single point of failure, which means that once the central server goes offline, teams members won't be able to collaborate or save snapshots of their project, until the server comes back online.
Distributed
In this type of Architecture, every team member has a copy of the project with its history on their machine, this allows each team member to still save a snapshot of the project on their machine, even when the server is offline they can still synchronise their work with other members on the team. E.g Git, Mercurial. Git is the most popular VCS in the world, why is this so?
- Free
- Open-sourced
- Superfast
- Scalable
- Cheap Branching/Merging
More than 90% of all software in the world uses Git.
Ways to use Git
There
The command line Git can be used on the command line, by opening a terminal and execute git codes. It is the fastest and sometimes the easiest way to get the job done
Code editors and IDE These days IDEs now have built-in support for Git. For instance VS Code has a powerful plugin called GitLens. It brings a ton of hit features to VScode.
Graphical User Interfaces Git Kraken and Source tree are some of the popular GUI in these categories.
The command line is mostly used by developers due to some of the following reasons
- GUI tools have limitations
- GUI tools are not always available
It doesn't ma`tter which tool you use, what matters most is using the right tool and getting the job done.
Installing Git
To install git on your local machine go to the official Git page and follow the instruction pertaining to your Operating system.
In the next part of this series, I will discuss Configuration for Git.