Chapter #32: Learn Git and GitHub Basics
In this chapter, we introduce Git, explain what a Version Control System is, and show why Git is essential for developers and teams.

Git is the most popular version control system (VCS) used by developers and development teams to keep track of changes made to source code. In fact, it is the most popular version control system used in DevOps.
A Version Control System is software that tracks or records changes made to software code over time in a special database referred to as a repository. With Git, you can track project history and see what changes were made and who made them.
You can also roll back the changes to get back to your original code. In addition, Git allows multiple people to collaborate on the same project irrespective of their location.
Version Control Systems can be categorized into two: Centralized and Distributed.
Centralized
In a centralized system, all users connect to a central server to get a copy of the software code and share it with others.
Examples of centralized Version Control Systems include Subversion, which is distributed under the Apache License, and Microsoft Team Foundation Server (Microsoft TFS).
The drawback of centralized VCS is the existence of a single point of failure. When the central server goes down, the team members can no longer collaborate on the project.
Distributed
With distributed systems, each team member gets to have a copy of the code project on their local machine.
If the central server experiences downtime, users can synchronize the software code with others without a problem.
Examples of Distributed Version Control Systems include Git and Mercurial.
Why Use Git?
Of all the Version Control Systems that we have mentioned, Git is the most popular and widely used VCS, and for good reasons, it is a free and open-source, scalable, fast, and reliable.
You can track changes made to code and easily collaborate on a project with other team members. In addition, operations such as branching and merging are far much easier in Git than in Mercurial or any other VCS.
Nowadays, Git is ubiquitous and is used by both small companies and large enterprises to efficiently manage software code. For that reason, itβs one of the most in-demand skills for developers or those getting into software development.
So if you are looking into getting a job as a software developer, bear in mind that Git is a prerequisite. You should have a thorough knowledge and understanding of this Version Control System tool.
In this tutorial, we will walk you through Git basics and how you can efficiently manage your code.
Git and GitHub
We cannot talk about Git without mentioning GitHub. These two are intertwined and often go hand in hand.
In fact, a lot of people think that Git and GitHub are the same. However, these are two separate things that integrate with each other.
GitHub is a code hosting platform for Git repositories. It's essentially a website where developers and project managers host their software projects.
It makes it easy for team members or developers to coordinate and track changes made to code, as well as make updates where needed.
In doing so, GitHub promotes collaboration, transparency, and helps team members to work from anywhere and stay up to date with the latest changes made to code.
In GitHub, packages can be published publicly, allowing access to the outside world, or privately within team members. Once shared publicly, users can download the code and try it out on their personal computers.
In summary, GitHub is an online code hosting platform that provides a cool UI and allows you to host remote Git repositories and work collaboratively with other developers from anywhere.
On the other hand, Git is what handles the version control operations like pushing and merging code, making commits, cloning repositories, etc. Now, let us explore various Git commands that you can use to work with GitHub.