How to install git on ubuntu 16.04

This small howto post covers the installation and configuration of Git client on your ubuntu 16.04. We will install git version 2.9.3 that comes with a large number of updates versus previous release 2.8. Git is a version control system that is used for software development and other version control tasks.

This post assumes you have at least basic knowledge of Linux, know basic shell command for Linux. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Git on Ubuntu 16.04 (Xenial Xerus) server.

Step 1 – Update repository list.

First make sure that all your system packages are up-to-date by running these commands in the terminal.

# sudo apt-get update

Step 2 – Installing Git

Ubuntu 16.04 default repo comes with Git 2.7.x. As versions 2.9 are not part of the Ubuntu repositories, you need to add the git-core personal package archive. Run the following commands in Terminal to install Git 2.9.3 on Ubuntu, via PPA:

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

Step 3 – Installation check

To check if our installation has been successfully and current version installed of Git use following command:

# git --version
git version 2.8.1
Related Post