how to install GIT on Ubuntu

How to Install GIT on Ubuntu and Other GNU/Linux Systems?


GIT is a service that facilitates the work of updating various information on a remote server, also by different people. And this is not only about software development, but also, for example, storing and synchronizing passwords of the Password Store program. With this version control system, it’s easier to keep track of data changes and make changes quickly. This article describes how to install GIT on Ubuntu and other GNU/Linux systems.

Installing GIT via PM

Since GIT is the leader among all known version control systems, many distributions, if they do not install it by default, then at least add it to the standard repository. Probably there will not be the latest, but stable version.

In almost all operating systems, the necessary package is called git. Below are the installation commands for some distributions. Please note that these actions require appropriate privileges, so either append sudo first, or log in as superuser.

Debian/Ubuntu/Mint apt install git
Arch/Manjaro pacman -S git
Fedora 22+ dnf install git
openSUSE zypper install git

The package can also be found in the graphical PM.

install git ubuntu

In Ubuntu, you can add another GIT repository to install its latest version:

add-apt-repository ppa:git-core/ppa && apt update && apt install git

Installing GIT from Source

This method is usually used just to operate the latest version of GIT in Ubuntu and Fedora. However, there is no other option for RHEL, Oracle Linux, CentOS systems (in fact, there is the IUS Community Project, but this is another story).

First download all the dependencies you need:

Fedora dnf install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
Ubuntu apt install build-essential libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev unzip

Then get the latest GIT archive from the mirror server or on the project page on github.

install git linux

Extract the files from the archive of one of the following commands (in this case, the GIT version is 2.23.0):

tar archive tar -zxf git-2.23.0.tar.gz
zip archive unzip git-2.23.0.zip

Go to the newly created folder and execute the line:

make prefix=/usr/local all && sudo make prefix=/usr/local install

Now, located in this directory, you can update GIT with the command:

git clone git://git.kernel.org/pub/scm/git/git.git

You may also like:

How to Install Docker on Ubuntu? Nowadays software portability has become increasingly relevant. The architecture of computers and operating systems is constantly evolving; applicatio...
How to Fix Unable to Lock the Administration Direc... At the beginning of their administrative journey, GNU users are faced with various errors and problems that cannot always be resolved from the first t...
How to Use ntpdate to Sync Time in Linux? Ntpdate is a console utility that can be used as an NTP client in various Linux distros to synchronize the local time of a host with the global time o...
How to Install deb and rpm Files and Their Managem... GNU/Linux software package management is quite diverse. This is, of course, related to the different architecture of the operating systems. Somewhere ...
How to Check Network Usage on Linux? GNU/Linux system administrator involved into a huge number of tasks. The most significant of these include checking the OS’s network usage. GNU/Linux ...

Add Your Comment