Learn Git #1: What is Git?

Neha Saggam
2 min readMar 29, 2020

--

Git is a distributed version control system.

Before, we get into Git details, lets understand what is the version control and why do we need it ?

What is VCS (Version Control System) ?

A software tool to manage various versions of our source code.

Why / Benefits of having VCS:

  • Keeps records of code changes
  • Collaborative development
  • Who made changes and when
  • Allows undoing / reverting changes and going back to previous state of our source code.

So, Git is one of the tools to get the benefits of VCS. There are other tools as well like CVS, SVN which offer a centralised version control.

P.S. You can search difference between centralised and distributed and its drawbacks.

Lets understand the word `distributed` in terms of git.

As you see in the image, there are three developers working on single source code.

Git contains a directory, a directory where your source code files reside.

Git maintains 2 copies of directory, one on centralised remote server and the other one on the developer’s local machine.

For example:

Gaurav, creates an empty directory on his local machine.

He created two directories src/index.js, tests/index.js and saves the changes to his directory present locally.

These changes are on the local machine, he needs to push these changes to remote machine to make it available for other developers which can be done.

Now, Neha needs those code changes so, she will pull the changes (made by Gaurav) and so does Priya.

They perform a few changes save those changes on their respective local directories and then push those changes to remote repository.

To conclude, developer makes changes to local => pushes them to remote server.

I know you have a lot of questions but hold on for the next blog to come. I would explain the commands mentioned here in detail. Till then, Stay tuned! 😃.

Also, please comment below and help me improve my blogging skills 😁.

--

--

Neha Saggam

An application developer, a nature lover and an imaginary traveller.