Git Tutorial for beginners (Part I)

In Git Tutorial for beginners (Part I), we will have a basic understanding of Git.

What is Git?

Git is the most commonly used Distributed Version Control System nowadays. Now the question that comes in your mind is ” What is Distributed Version Control System?”.

So before beginning let us understand what is the Version control system and their types.

Version Control System:

The Version Control system is a system that allows you to go back to the previous version of any file.

Let’s understand it in more details:-

let us suppose you are working on a file and committed some changes. Suppose you did three changes in the last three consecutive days, and for some reason, you want to go back to your original version or on the second day’s changes. In such situations, we will require ” Version Control System” as it records all changes in different versions and allows you to go back to any version. This is not only limited to a file only but also helpful for the entire Project. It also helps to find the culprit who committed wrong changes and also allows you to compare the changes over time.

 Types of Version Control System and their roles.

Version Control System is of two types:

Local Version Control System:

It’s a local database of a user that keeps all the changes to files for Version Control.

It’s a single point of failure. If the local system goes down, everything goes down if you have no backup.

Eg. RCS

Centralized Version Control System:

This is a Server-Client architecture. A single Server contains all the information about all the files that are being changed by clients and allows you to go back to any version as per the requirement.

Clients do a checkout from the Server to get the latest changes.

It’s a single point of failure. If the local system goes down, everything goes down if you have no backup.

Eg. SVN

Distributed Version Control System:

This is also a Server-Client architecture. A single Server contains all the information about all the files that are being changed by clients and allows you to go back to any version as per the requirement.

Clients do a checkout from the Server to get the full clone of the repository.

It’s not a single point of failure. If the server goes down, do not worry, you can restore the server from any of the client repositories.

Eg. Git

A very important thing to notice about Git and other Version Control System is that whenever you commit(save changes) git takes a snapshot of that state and can be restored at that point of time, while other Version Control Systems do changes to each and every file as soon as you do commit.

Some essential things to know about Git.

Three Stage of Git

There are three stages of Git –  Modified and Staged, Committed.

Modified:  You have changed the file but neither marked nor committed.

Staged:  You have marked the modified files but not committed.

Committed: Saveddata in your local git repository.

 

Three Sections of a Git-Projects

There are three sections of a Git-Project that we need to know:

.git directory( Repository): This is a local directory, where you clone any repository from Git-Hub/Git-Lab(Centralized Repository).

Working Directory:  This is a local directory where you change or modify your files.

Staging Area: This is an area where all those files reside that are marked for the next Commit.

 

I hope you enjoyed this blog, please feel free to put your comments in the comment box.

We will continue this in my next blog- Git Tutorial for beginners (Part II)

If you think we have helped you or just want to support us, please consider these:-

Connect to us: Facebook | Twitter

You may also like…

3 Responses

  1. SOMEER BHATTACHARYA says:

    GOOD
    I like it

  2. SOMEER BHATTACHARYA says:

    Thanks for advance

  3. cchakravarty says:

    Thanks Someer !!

Leave a Reply