Installing Git

This recipe covers the installation of Git binaries on the Ubuntu server. As always, we will install the latest available Git package.

Getting ready

You will need access to a root account or an account with sudo privileges.

How to do it…

Git maintains a separate repository of the latest binaries on Launchpad. We will use PPA for this repository,to install the latest Git version:

  1. Add PPA to the Ubuntu installation source:
    $ sudo add-apt-repository ppa:git-core/ppa
    
  2. Update the apt repository cache:
    $ sudo apt-get update
    
  3. Now, install Git with a simple apt-get install git command:
    $ sudo apt-get install git -y
    
  4. Once installation completes, you can check the Git version with the following command. You can cross check the version with the official ...

Get Ubuntu Server Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.