Saturday, August 12, 2017

With GIT Power Comes Great Repository

Recently I officially break out of windows,… rather dramatically with all the matrix effect of micro seconds vibrating and then blowing windows and everything, and yes I did a super hero landing on Linux Kernel. It was an exceedingly exciting moments, my laptop is now super fast, considering her archaic processing power.
In honor of such high adraniline action feat, sharing Git basic concept by comparing Middle Age Feudal system. 
After all according to Stan Lee : With Great Power comes Great Responsibility  So set on your knight armor and start our adventure.

  In this blog I would like to share the simple and basic things about git from initializing it to committing.

First Why Git?!?!?

 Git can be used by anyone who uses a computer, developer, writer, accountant, even north korea military leader's hair stylist(he won't be praying for his life, even if he had chopped a hair off his leader...accidentally).

Git is a tool for Version Control, meaning every time you make a change to your file/files git has a snapshot of it and at any moment of time you can retrieve those snapshots. There are many books that go deep enough one of which is Pro Git …. But Before all the technical terms lets go back in time, where scientific endeavor was considered a witchcraft, and common cold was deadly.

Back to a few hundreds years
In Feudal times: when ever a new person arrives to the city out side the city gates, he makes sure he is registered in the royal archives. Once he is allowed into the city walls, he is summoned to the throne and registered into the royal archive.

And he is back into the city walls, market place, pub you name it. If he is changing his stays or his status, marriage, adopting a puppy, buying a slave, or thinking of who the hell is blogging about him, all has to be registered. He is summoned again to give details on his ventures, and all of it is registered. 

That is pretty much the cycle, even followed in the modern times, except buying a slave in open market, it's done in the dark.
We will correlate the almost identical features of Castle Code of Conduct with Git concept
The city gates is the folder in which you have set your git with the following command


$git init
//castle and its all rules and orders are created in instance

$git status
//a reporting request on the status of the file which includes how many people are outside the city gates, registered within, or not updated status.
//in git terms: untracked files and tracked files:- which could be one of the following
  • unmodified
  • modified
  • staged

    When a new file (new person arrived) is created, its outside the git repository, it need to get into the city walls for registry 

    $git add <person/file>
    //person/ file is queued for registry into royal archive/ git repository
    //In Git Terms: it is staged, ready to be committed

    $git commit
    then the person/file is registered/committed into git repository or royal archive. Which means the royal archive has everything they need about the person/file at that instant of time.
    He/the file is in the unmodified state. 

    After that new experience the file/person is out into the city, market place/mosque/church/... for any sort of activity.
    Then the file/person is in the modified state, to update his/its status he/it has to be summoned again,
    queued (Staged) then at registry of the updated content it is committed(snap shot of the person/file is archived).
    It is back to the unmodified stage. 

    The cycle goes like this.

    THAT'S IT !!! GIT in Feudal times in a royal nutshell.

    To be harshly honest that this is just the tip of the tip of Git Ice burg, Once you admire the beauty of Git, its for sure you will get addicted to it, chronically in fact ;-) 

    So Get up, install Git into your machine try out the royalty in full throttle.