How to install Git on Ubuntu

Endrit Qerreti

Endrit Qerreti

Git is a free and open source version control system, that allows you to keep track of your software versions.

If you are working on a software and releasing new versions of the software, then git allows you to archive the old versions of your software when you publish new versions/updates.

So if something breaks, or if the last updated you released had bugs, then you can easily revert the code by using git.

git can be installed on Ubuntu and Debian based distros easily by downloading the git package, and by using the official ppa that git provides.

In this tutorial, you will learn how to install git on Ubuntu.

Install git on Ubuntu via Ubuntu repository

ppa it's not the only source that you can use to install git. git package git is also available on Ubuntu repositories, and you can easily install git on your machine by using only the terminal.

To install git on Ubuntu via terminal, run the following.

sudo apt install git

Install git on Ubuntu via git PPA

Git has its own ppa that allows you to install git on your machine.

Step 1 - Add git PPA

To add git PPA on your machine, you can do so by running the command below.

sudo add-apt-repository ppa:git-core/ppa

Step 2 - Update packages

Once you have added git PPA on your machine, now you need to update packages on your machine , in order for the new repository to be used.

sudo apt update

Step 3 - Install git

Now you can simply install git on your machine. To do so, simply run the command below.

sudo apt install git

Conclusion

In this tutorial, you learned how to install git on Ubuntu, via two different ways. By using the official git PPA, and by installing the package git from Ubuntu repositories.