Monday, November 11, 2013

Installing GIT in Linux (apt and rpm based systems)

Git /ɡɪt/ is a distributed revision control and source code management (SCM) system with an emphasis on speed. Git was initially designed and developed by Linus Torvalds for Linux kernel development in 2005.

Installing GIT:

GIT can be installed in many  ways. The two major ones are: to install from source and to install from an existing 
package for your platform i.e apt based (Ubuntu, Debian) or rpm based ( Fedora ).

Installing from Source:



$ yum install curl-devel expat-devel gettext-devel \
  openssl-devel zlib-devel

$ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \
  libz-dev libssl-dev


When you have all the necessary dependencies, you can go ahead and grab the latest snapshot from the Git web site:
http://git-scm.com/download
or you can download the package using wget:
$ wget https://git-core.googlecode.com/files/git-1.8.4.2.tar.gz
Then, compile and install:
$ tar xf git-1.7.2.2.tar.gz
$ cd git-1.7.2.2
$ make prefix=/usr/local all
$ sudo make prefix=/usr/local install

Installing on Linux

If you want to install Git on Linux via a binary installer, you can generally do so through the basic package-management tool that comes with your distribution. If you’re on Fedora, you can use yum:
$ yum install git-core
Or if you’re on a Debian-based distribution like Ubuntu, try apt-get:
$ sudo apt-get install git
That's it.
The first thing you should do when you install Git is to set your user name and e-mail address. This is important because every Git commit uses this information, and it’s immutably baked into the commits you pass around:
$ git config --global user.name "Digital Exploits"
$ git config --global user.email digitalexploits@example.com

Again, you need to do this only once if you pass the --global option, because then Git will always use that information for anything you do on that system. If you want to override this with a different name or e-mail address for specific projects, you can run the command without the --global option when you’re in that project.
If you want to check your settings, you can use the git config --list command to list all the settings Git can find at that point:
$ git config --list
user.name=Digital Exploits
user.email=digitalexploits@gmail.com
...

0 comments:

Post a Comment