Installing from Source:
In short, on a Unix-based system, you can download the Git source code from the Git Download Page, and then run
something along the lines of :
$ make prefix=/usr all ;# as yourself
$ make prefix=/usr install ;# as root
You will need the expat, curl, zlib, and openssl libraries installed – though with the possible exception of expat, these will normally already be there.
If you are running Linux, you can likely install Git easily via your native package management system:
$ yum install git-core
$ apt-get install git-core
In both Mac 10.4 and 10.5, you can install Git via MacPorts, if you have that installed. If not, you can install it from here.
Once MacPorts is installed, all you should have to do is:
$ sudo port install git-core
If you prefer to install from source, these articles may be helpful:
Article: Installing Git on Tiger
Article: Installing Git and git-svn on Tiger from source
With Leopard, you can also install via MacPorts, but here you have the additional option of using a nice installer, which you can download from here: Git OSX Installer
If you prefer to install it from source, these guides may be particularly helpful to you :
Article: Installing Git on OSX Leopard
Article: Installing Git on OS 10.5
SETUP AND INITIALIZATION
The first thing you’re going to want to do is set up your name and email address for Git to use to sign your commits.
$ git config –global user.name “Rushabh hathi”
$ git config –global user.email “firstname.lastname@example.org”
That will set up a file in your home directory which may be used by any of your projects. By default that file is ~/.gitconfig
and the contents will look like this:
name = Rushabh Hathi
email = email@example.com
If you want to override those values for a specific project (to use a work email address, for example), you can run the git config command without the –global option while in that project. This will add a [user] section like the one shown above to the .git/config file in your project’s root directory.