How To Install git on Ubuntu 20.04

In this tutorial we learn how to install git on Ubuntu 20.04. git is fast, scalable, distributed revision control system fast, scalable, distributed revision control system fast, scalable, distributed revision control system

Introduction

In this tutorial we learn how to install git on Ubuntu 20.04.

What is git

git is:

Git is popular version control system designed to handle very large projects with speed and efficiency; it is used for many high profile open source projects, most notably the Linux kernel.

Git falls in the category of distributed source code management tools. Every Git working directory is a full-fledged repository with full revision tracking capabilities, not dependent on network access or a central server.

This package provides the git main components with minimal dependencies. Additional functionality, e.g. a graphical user interface and revision tree visualizer, tools for interoperating with other VCS’s, or a web interface, is provided as separate git* packages. Homepage: https://git-scm.com/

Package: git Architecture: amd64 Version: 1:2.25.1-1ubuntu3.1 Multi-Arch: foreign Priority: optional Section: vcs Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Jonathan Nieder [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 35680 Provides: git-completion, git-core Depends: libc6 (>= 2.28), libcurl3-gnutls (>= 7.56.1), libexpat1 (>= 2.0.1), libpcre2-8-0 (>= 10.22), zlib1g (>= 1:1.2.0), perl, liberror-perl, git-man (» 1:2.25.1), git-man (« 1:2.25.1-.) Recommends: ca-certificates, patch, less, ssh-client Suggests: gettext-base, git-daemon-run | git-daemon-sysvinit, git-doc, git-el, git-email, git-gui, gitk, gitweb, git-cvs, git-mediawiki, git-svn Breaks: bash-completion (« 1:1.90-1), cogito (<= 0.18.2+), dgit (« 5.1~), git-buildpackage (« 0.6.5), git-core (« 1:1.7.0.4-1.), gitosis (« 0.2+20090917-7), gitpkg (« 0.15), gitweb (« 1:1.7.4~rc1), guilt (« 0.33), openssh-client (« 1:6.8), stgit (« 0.15), stgit-contrib (« 0.15) Replaces: git-core (« 1:1.7.0.4-1.), gitweb (« 1:1.7.4~rc1) Filename: pool/main/g/git/git_2.25.1-1ubuntu3.1_amd64.deb Size: 4556992 MD5sum: f92cd961b120bb2fb82664c75e60e7f4 SHA1: 6652d650cd8e49fd08bbe39a28c8be9db7d8612c SHA256: 678ae48221ea7bf2b2c1befd38c69fcc1049c4ac39125cd259096b6b909ab615 SHA512: 40c97b9c22b668d249aea10818482e7de769841595d2e7c2222466a80440d2a01f57f22966f61bae30f277d407c68b7bcd74379c592c3a0c34f5fefa0c495b9f Homepage: https://git-scm.com/ Description-en: fast, scalable, distributed revision control system Git is popular version control system designed to handle very large projects with speed and efficiency; it is used for many high profile open source projects, most notably the Linux kernel.

Git falls in the category of distributed source code management tools. Every Git working directory is a full-fledged repository with full revision tracking capabilities, not dependent on network access or a central server.

This package provides the git main components with minimal dependencies. Additional functionality, e.g. a graphical user interface and revision tree visualizer, tools for interoperating with other VCS’s, or a web interface, is provided as separate git* packages. Task: server, cloud-image, lubuntu-desktop

Package: git Architecture: amd64 Version: 1:2.25.1-1ubuntu3 Multi-Arch: foreign Priority: optional Section: vcs Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Jonathan Nieder [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 35680 Provides: git-completion, git-core Depends: libc6 (>= 2.28), libcurl3-gnutls (>= 7.56.1), libexpat1 (>= 2.0.1), libpcre2-8-0 (>= 10.22), zlib1g (>= 1:1.2.0), perl, liberror-perl, git-man (» 1:2.25.1), git-man (« 1:2.25.1-.) Recommends: ca-certificates, patch, less, ssh-client Suggests: gettext-base, git-daemon-run | git-daemon-sysvinit, git-doc, git-el, git-email, git-gui, gitk, gitweb, git-cvs, git-mediawiki, git-svn Breaks: bash-completion (« 1:1.90-1), cogito (<= 0.18.2+), dgit (« 5.1~), git-buildpackage (« 0.6.5), git-core (« 1:1.7.0.4-1.), gitosis (« 0.2+20090917-7), gitpkg (« 0.15), gitweb (« 1:1.7.4~rc1), guilt (« 0.33), openssh-client (« 1:6.8), stgit (« 0.15), stgit-contrib (« 0.15) Replaces: git-core (« 1:1.7.0.4-1.), gitweb (« 1:1.7.4~rc1) Filename: pool/main/g/git/git_2.25.1-1ubuntu3_amd64.deb Size: 4553836 MD5sum: 1a0e037dde4bc91ead9e776057d809c4 SHA1: d55922ea8f62bbbadf290589c15752fbb6d625df SHA256: b95444c42c51dd0a65b3d5ef3dafcb1401a935aef5cc7d42a7f2023c415f295c Homepage: https://git-scm.com/ Description-en: fast, scalable, distributed revision control system Git is popular version control system designed to handle very large projects with speed and efficiency; it is used for many high profile open source projects, most notably the Linux kernel.

Git falls in the category of distributed source code management tools. Every Git working directory is a full-fledged repository with full revision tracking capabilities, not dependent on network access or a central server.

This package provides the git main components with minimal dependencies. Additional functionality, e.g. a graphical user interface and revision tree visualizer, tools for interoperating with other VCS’s, or a web interface, is provided as separate git* packages. Task: server, cloud-image, lubuntu-desktop

There are three methods to install git on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install git Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install git using apt-get by running the following command:

sudo apt-get -y install git

Install git Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install git using apt by running the following command:

sudo apt -y install git

Install git Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install git using aptitude by running the following command:

sudo aptitude -y install git

How To Uninstall git on Ubuntu 20.04

To uninstall only the git package we can use the following command:

sudo apt-get remove git

Uninstall git And Its Dependencies

To uninstall git and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove git

Remove git Configurations and Data

To remove git configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge git

Remove git configuration, data, and all of its dependencies

We can use the following command to remove git configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge git

References

Summary

In this tutorial we learn how to install git package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.