Git is a distributed revision control and source code management system released in 2005 and distributed under GNU General Public License v.2. Git handles large amounts of data and possesses tracking capabilities which are non-dependent on network access or central server.
This tutorial will cover the installation of Git on Debian 7.
Installation of Git Using Apt-Get
You can install Git using the apt-get command:
sudo apt-get install git-core
Once the installation is done, you can proceed to configure it.
Installation of Git from Source
In case if you want the latest version of Git to be installed from source, here is how:
Before starting the installation, update the system packages using apt-get update.
Now, you need to download the required dependencies using the command:
sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential
Now, install the latest version of Git from google code page:
Untar the file and switch into that directory:
tar -zxf git-126.96.36.199.tar.gz cd git-188.8.131.52
Global installation would require two steps – installing as yourself and as root user.
make prefix=/usr/local all sudo make prefix=/usr/local install
Git Set Up
Once Git is installed, you need to copy your username and email in the git config file.
Open the config file and add the following lines of code to it:
sudo nano ~/.gitconfig
git config --global user.name"NewUser" git config --global [email protected]
Save the file.
If you want to verify the settings, you can use the command:
git config --list
Git is installed on your system.