Install GIT on Debian 10

Windows Articles

How to create GPO in Windows Server 2019.

Hi, in today's post we will be looking at GPOs in Windows Server 2019. The Group Police Object are a set of...

How to install OpenLiteSpeed on Ubuntu 20.04?

There are several web servers for Linux but other alternatives are always welcome. In this case, I will show you how to...

Linux 5.7 available

Time passes very quickly and we already have a new version of the Linux kernel that as always we are happy because...

How to install RStudio on Ubuntu 20.04 / 18.04

No matter how complete and robust a programming language is, the programmer will always need a tool to write the code. These programs have...

How to install Arduino IDE on Ubuntu 20.04 / 18.04 / Linux Mint 19.X?

Hi, folks. In this post, we will show you how to install Arduino IDE on Ubuntu 20.04/ 18.04 and Linux mint 19.x. You probably already...
angeloma
angeloma
Senior Writer and partner

Software development is one of the activities that can best be done on a Linux system. In the first place, because it is stable and because the main tools for development are available with few commands. We are talking about both professional and community-level tools. They are all installable on Linux. One of these tools is GIT which is used to control the versions of an application. So, in this post, you will learn how to install Git on Debian 10. We will even give you two options to realize the goal.

So, Git?

If you are starting to develop applications you may not know that Git is a free, open-source version control system and that it is perhaps the best. Many developers rely on it to control the versions of their applications. By versions, we mean those in development.

Using Git you can control and separate development in each of those development branches. So the changes of one do not affect the others.

Read Introduction to the Git branches.

In this way, it is good practice to develop applications using a version control system as support.

Install Git on Debian 10

Debian 10 is one of the few distributions that have such complete package repositories. So, presumably, there is some Git in the official repositories.

However, it is also a good idea, to know how to install Git differently in case we need it. This way is compiling the source code of Git and get the latest stable version. In this tutorial, I will teach you how to do it both ways.

1) Using the official repository

Debian 10 comes with Git 2.20 in the official repositories. That is, it is a good version, but with the passage of time, it will become obsolete.

Using this option, the installation is quite easy, and just open a terminal session and run the following command:

:~$ sudo apt install git

Or, if you do not have sudo, please read How to enable sudo on Debian 10?

Then, you can check the installed version.

:~$ git --version
git version 2.20.1

Now, you can use it.

2) Building the Git source code

Compiling the Git source code is the best way to get the latest version. All this in a safe way because it will not be compiled by third parties.

The process is simple but requires a few extra steps. So let us get started.

First, install the necessary programs to make the compilation:

:~$ sudo apt install build-essential make libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip

1.- Install required package for the build from source code
1.- Install required a package for the build from source code

Now, we can download the source code.

:~$ cd /tmp/
:~$ wget https://github.com/git/git/archive/v2.22.0.zip -O git.zip

2.- Download Git code
2.- Download Git code

Next, decompress it and access to the folder.

:~$ unzip git.zip
:~$ cd git-2.22.0

Now, you can start the compilation by running the following commands:

:~$ sudo make prefix=/usr/local all
:~$ sudo make prefix=/usr/local install

3.- Install Git on Debian 10
3.- Install Git on Debian 10

Next, check the installed version.

:~$ git --version

4.- Git installed
4.- Git installed

And that is it. You can start to use Git.

Conclusion

Git is one of those applications that every developer must be able to manage to improve their workflow. Therefore, it is important to install it in Debian 10 and two ways have been shown to achieve this. One of them is using the package available in the official repositories and the other is compiling the source code.

Please share this post and join our Telegram channel.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to create GPO in Windows Server 2019.

Hi, in today's post we will be looking at GPOs in Windows Server 2019. The Group Police Object are a set of...

How to install OpenLiteSpeed on Ubuntu 20.04?

There are several web servers for Linux but other alternatives are always welcome. In this case, I will show you how to...

Linux 5.7 available

Time passes very quickly and we already have a new version of the Linux kernel that as always we are happy because...

How to install RStudio on Ubuntu 20.04 / 18.04

No matter how complete and robust a programming language is, the programmer will always need a tool to write the code. These programs have...

How to install Arduino IDE on Ubuntu 20.04 / 18.04 / Linux Mint 19.X?

Hi, folks. In this post, we will show you how to install Arduino IDE on Ubuntu 20.04/ 18.04 and Linux mint 19.x. You probably already...