[1/2] What is Git? Beginner's Guide to using GitHub

[1/2] What is Git? Beginner's Guide to using GitHub

I've just started my blogging journey and I feel writing about Git in my very first blog makes a lot of sense, because:

  1. Git is the most resourceful tool for developers of all levels
  2. Knowing about Git at an earlier stage is very essential as it can precisely reflect your journey of learnings. So, let's get started with it.

What is version control? Version control, also known as source control, is a system used to maintain changes in files or a group of files over a period of time. The advantage of doing so is that it enables us to rewind back the changes, if needed. For example, if a software has been version controlled, one can go back to any version of that software. Let's see a real world illustration of this use case:

image.png

image.png

In the above images, we can see that there has been multiple releases of the project and the links to it can help us retrieve the source code of that exact version.

Traditionally, the version-control method used by the people was to copy files from their working directory into another directory. Some of them used to make use of time-stamped directories. This approach used to be very common before because of it's simplicity, but it also proved to be incredibly error prone. It is easy to forget which directory you’re in and accidentally write to the wrong file or copy over files you don’t mean to.

To surmount this issue, programmers first developed local VCSs which used to have a simple database to track all the changes to files under version control, however, even this system came with its own cons. Hence, after a few years, the need of an efficient solution to the problem enabled the programmers develop Distributed Version Control Systems (such as the Git, Mercurial, etc.) With the development of DVCs, the clients were able to mirror the entire repository of the software (along with the different versions), collaborate with different teams remotely and carry out the workflow in a decentralized manner which was difficult to implement before.

So, what is Git in a nutshell? Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. It can be treated as a time machine which allows us to go back to any date (version in the case of Git) we want. It is extremely easy to learn and requires a very small amount of memory to run. Despite its very small memory consumption, Git can offer lightning fast performance.

People prefer using 'Git' because of the following benefits:

  1. It helps you to manage your files efficiently.
  2. It helps multiple people to collaborate simultaneously on a single ongoing project
  3. Snapshots(Changes) of all versions are properly documented and stored.
  4. Versions are also named accurately
  5. It can act as a backup, in case your central server crashes. You don’t have to worry it will be in your local repository.
  6. When you change a version, Git provides you with a proper description of what was changed, when was it changed and who changed it.

Git is the best choice for most software teams today. Therefore, it becomes extremely important for a software developer to know about Git. There are distribution services like GitHub, Bitbucket, and GitLab which help us to host our Git-based projects on the internet and in this blog, we will making use of GitHub, though all the channels are equally cool and widely used.

In the next part, we will be covering some of the most essential things about using GitHub so stay tuned!