Installing Git on Ubuntu/Debian systems

To install Git on Ubuntu systems, follow these steps:

  1. From your shell, install Git using the apt-get command:
$ sudo apt-get update
$ sudo apt-get install git  
  1. Verify the installation was successful by typing git --version:
$ git --version
git version 2.9.2  
  1. Configure your Git username and email for a single repository:
$ git config --global user.name "firstname lastname"
$ git config --global user.email "email@gmail.com"  
  1. Install the necessary dependencies using the apt-get command:
$ apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc xmlto docbook2x  
  1. Clone the Git source (or if you don't yet have a version of Git installed, download and extract it):
$ git clone https://git.kernel.org/pub/scm/git/git.git  
  1. To build the Git source and install it under /usr, run make:
$ make all doc info prefix=/usr
$ sudo make install install-doc install-html install-info install-man prefix=/usr  

With this, we have discussed installing and configuring Git on different platforms, including Windows, CentOS, and Linux systems.