Git And GitHub (Working area, staging area, and repository)

What is git ?

But first, let’s answer the question of what exactly a git version control system is.

Git is an open source distributed version control system developed by the same person that created Linux. It works on every major operating system – Linux, Windows, and Mac OS, so no matter which you use, git will work there. 

Git as a version control system makes it easy for a team like yours to keep track of every change made to projects, during the development process. All developers share the code, stored in the repository, work on it independently, and the code is merged back together to push the project forward. 

With git, there is no need to be connected all the time, because your projects are saved locally and remotely on a server. This also means that the changes you create will not affect the project unless you decide to merge your code with the existing one in the repository. This is a great way to ensure your code’s safety. 

Another great advantage of git is the fact that you can easily check or revert to previous versions of your code – hence the name version control system.

Working area, staging area, and repository

Let’s take a closer look into the three areas in Git where code resides.

The first is the working area also called the working tree. In brief, it is a space where reside files that are not in the staging area. In the same way that you keep files in a local directory.

The second is the staging area, which stores files that are going to be a part of your next commit. That’s exactly how Git knows what is going to change between the current commit and the next one.

The last one, the repository contains all of the commits. What is the commit? It is a snapshot of what the working and staging area looked like during the time of the commit.

In short, we add files from the working area to the staging area, and then we commit from the staging area to the repository.

Git vocabulary

Now that we know what git is before we will install it, you should know some of the basic vocabulary, as at first, it might be quite intimidating, but is necessary to understand what is happening.

Repository

You can say that the repository is the container that has all the things involved with your project that git tracking. It includes the files and directories related to your project, the history of changes, and other related information. In more common situations it is referred to as a “repo”.


Comments

Popular posts from this blog

complete CI/CD

Basic Overview Of project and Work

Introduction To Docker