Sunday 25 November 2012

GIT INTRODUCTION AND INSTALLATION





Git is a distributed revision control and source code management (SCM) system with an emphasis on speed. The major difference between Git and any other VCS is the way Git thinks about its data. Conceptually, most other systems store information as a list of file-based changes. These systems (CVS, Subversion, Perforce, Bazaar, and so on) think of the information they keep as a set of files and the changes made to each file over time.

 Git thinks of its data more like a set of snapshots of a mini filesystem. Every time you commit, or save the state of your project in Git, it basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot. To be efficient, if files have not changed, Git doesn't store the file again, just a link to the previous identical file it has already stored. Git stores data as snapshots of the project over time as shown in the figure below:




Git has three main states that your files can reside in: committed, modified, and staged. Committed means that the data is safely stored in your local database. Modified means that you have changed the file but have not committed it to your database yet. Staged means that you have marked a modified file in its current version to go into your next commit snapshot.

Three main sections of a Git project:




The working directory is a single checkout of one version of the project. These files are pilled out of the compressed database in the Git directory and placed on disk for you to use or modify.

The Git directory is where Git stores the metadata and object database for our project. This is what is copied when you clone a repository from another computer.

The staging area is a simple file, generally contained in your Git directory, that stores information about what will go into your next commit. 

Git Installation

Windows

First, download msisgit. This download is a single executable which installs the entire git system. While going through the installer, you will want to check the options to add Windows Explorer integration when you right click on a folder.


Because we will be using PuTTY as our SSH client, choose Use PLink and fill in the path to the downloaded plink.exe executable.



Continue clicking Next until the installation is complete.

Linux

On Fedora, you can use yum to install Git:
$ yum install git-core 
On Debian-based like Ubuntu, try apt-get:
$ apt-get install git-core 
Mac

Two easy ways to install Git on a Mac:
(1) Graphical Git Installer:
$ http://code.google.com/p/git-osx-installer 
(2) Install Git via MacPorts: 
Install MacPorts and then install Git via
$ sudo port install git-core +svn +doc +bash_completion +gitweb
Git Setup

Set your user name and e-mail address. Every Git commit uses this information while commits:
$ git config --global user.name "Python Hunter"
$ git config --global user.email pythonhunter@example.com
For special projects, to use different name or e-mail address, you can run the command without the -- global
$ git config user.name "Python Hunter"
$ git config user.email pythonhunter@example.com
Configure Tools

If you want to use different text editor such as Emacs:
$ git config --global core.editor emacs
If you want to configure diff tool to use to resolve merge conflicts such as gvimdiff:
$ $ git config --global merge.tool gvimdiff
Check your Settings

Check your git setting using the command:
$ git config --list
Git Help

To get help on Git, type the command given below along with your verb
$ git help <verb>
Example: $ git help config


[Expecting Your Valuable Comments]
Thank You

No comments:

Post a Comment