21 C
Texas
angeloma
Senior Writer and partner

How to install Git on Ubuntu 20.04?

Developers must use all available tools to make quality software. Some of these tools do not go directly to the software or the code but to its management. For example, version control is important to ensure that changes are made to the code in an orderly fashion. In this segment, Git seems to be the most logical alternative for this task. So in this post, we will show you how to install Git on Ubuntu 20.04

Git is a free and open source distributed version control system. It is perhaps the most popular within the branch as millions of developers use it to control software versions. Ease of use, community support, and efficient version control are the main features of Git. In addition, it is open source and free, which makes it ideal for all projects.

Of course, Git is available for almost any Linux distribution. It also has versions for Windows or MacOS. So no matter what platform you develop on, you will always have the advantages of using Git.

Install Git on Ubuntu 20.04

As we already know the official Ubuntu repositories host a lot of different packages. Most of these are open source and very important for the Linux ecosystem like Firefox.

- Advertisement -

On the other hand, they also host third party software such as Git. Yes, Git is available from the official Ubuntu 20.04 repositories.

So, to install it, just open a terminal and refresh your APT cache.

:~$ sudo apt update

Then, proceed with the installation:

:~$ sudo apt install git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  git-man libcurl3-gnutls liberror-perl
Suggested packages:
  git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
  git git-man libcurl3-gnutls liberror-perl
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 5695 kB of archives.
After this operation, 39.1 MB of additional disk space will be used.
Do you want to continue? [Y/n]

1.- Install Git on Ubuntu 20.04
1.- Install Git on Ubuntu 20.04

Enter the password and accept the installation proposal and it will start.

Then, check the installed version with the following command:

:~$ git --version
git version 2.25.1

2.- Git version
2.- Git version

Install Git on Ubuntu 20.04 using the official PPA

Installing an application from the official repositories is a guarantee of ease, compatibility, and reliability. However, likely, the last stable version of that program is not available, and sometimes it is necessary.

One proof of this is that Git improves with each version and incorporates security measures to make it even more secure. For example, in the official repositories, there is version 2.25 but as of this writing, the latest stable version is 2.26 and will continue to grow.

So, an alternative is to use the official Git PPA for Ubuntu.

To add the Git PPA repository, run the following command:

:~$ sudo add-apt-repository ppa:git-core/ppa
The most current stable version of Git for Ubuntu.
For release candidates, go to https://launchpad.net/~git-core/+archive/candidate .
More info: https://launchpad.net/~git-core/+archive/ubuntu/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it.

3.- Adding the Git repository
3.- Adding the Git repository

This same command will refresh the APT cache so when it’s done, just run it:

:~$ sudo apt install git

And if you’ve used the first method, just do a system upgrade:

:~$ sudo apt upgrade

Then, check the installed version:

:~$ git --version
git version 2.26.2

4.- Git new version
4.- Git new version

As you can see it has been updated to the latest stable version. Maybe at this moment, an update is not so necessary, but remember that Ubuntu will stay with us for 5 years and will become necessary with time.

Now, you’re ready. You can use Git now.

We’ll take this opportunity to show you which Git Linux clients we recommend.

Conclusion

Having the necessary tools makes any work easier and in the development of applications, it is clear that this mantra is fulfilled. So, Git is one of those applications that help control the development cycle of an application. It also helps developers control contributions and code changes.

So, now that you know how to install it on Ubuntu 20.04 it’s your turn to work.

Please share this post and join our Telegram channel.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article