Monday 20 August 2012

GIT : "Keep your waste safe :)"

In my previous post i was talking about preserving your files and directories and i was wondering to search something about it, is there any tool to do it?

From last 5-6 months i was hearing about GIT.

I was thinking that What this GIT is all about? Yesterday i was googling about GIT and found lot of stuff about it. I deciphered bit about git, installed it on my laptop and got to know what this is all about?
 
 These days so many companies mainly software firms require some tools to control source code of their programs and also when so many programmers are working on a project then distributing the main thread among them so that they can do parallel work, having various versions and various repositories of files. Preventing data from any kind of corruption.

Essentially companies have large no. of database with them mainly files and directories of various versions and they constantly want to maintain and update these repositories. But doing it manually like copy files save them in a folder time-stamping them by giving them relevant names is common but as the structure grows it would become much difficult to maintain. Suppose you want to modify a file and something goes wrong and you want to revert  back onto the previous version then it is very difficult and probably you lost your code. GIT is something which gives you way to do it.

A most fascinating stuff about git is that this software is made by the same guy who developed linux yeah correct none other than Linus Torvalds. I just got to know it yesterday.

The main reason for the invention of this product is Linux Kernel. Linux Kernel is one of the complex project ever and Linus was maintaining his Kernel versions using Bitkeeper (A commercial tool for maintaining the source code). But according to linus, he was searching best tool for maintaining his kernel and he decided that he will not touch Linux kernel until he don't write his own software for maintaining it, and so Linus started to work on git.

Somewhere on wikipedia i read that he gave name git to it because Linus is a egotist man every product he make he named it to his name and  slang meaning of "git" is unpleasant person. So it implies linus is not a pleasant person ha ha :).

Presently there are various tools for maintaining the source code and versions of softwares. They have their own pros and cons. But if you talk about the distributed version control system tool then GIT is the best.

What is version control systems and why they are required?

Version control systems are used to maintain not only the source code of a project but any kind of file can be maintained using version control systems. It allows you to revert files back to the previous state, revert entire project compare changes who changed the code and when.

The second issue with version control systems are distributed developers, developers are distributed over large geographical regions what if they want to colloborate for a project. To deal with it Centralized Version Control System (CVCS) developed. GIT is also for distributed developers but it is a decentralized system.
 Because of the disadvantages of CVS a new paradigm is used for the maintenance of the source code that is Distributed Version Control Systems (DVCSs). Linus give negative credit to CVS and positive credit to Bitkeeper that motivated him to write git.

GIT Installations-

There are two ways to get GIT
1. One is from source codes
2. second is from Package for your platform but advantage is to install it from the source codes because in this way you can obtain latest version of git.

git depend upon the following libraries
curl, zlib, openssl, expat, libiconv

Simplest way to install git 
         installing git on your linux distribution via binary installer use
         $apt-get install git-core


The other way to install git is first to get all the libraries described above using the command
    $apt-get install curl-devel expat-devel gettext-devel openssl-devel zilb-devel

after installing all the libraries
download latest version from git website    
       

then compile and install
$tar -xzf git.tar.gz
$cd  in above unzipped directory
$make prefix=/usr/local all
$sudo make prefix=/usr/local install

after this, you can install git via git itself for updates-----

$git clone git://git.kernel.org/pub/scm/git/git.git

The above are very simple steps to setup your machine for working with git.
Soon i will come upon more interesting things about GIT.

I am gonna soon maintain a website where we will talk more about it. Although doing it yourself is the best way to learn the things, so install git and keep doing work on it..

Let me know if you are facing trouble in setting up git on your machine...



No comments:

Post a Comment