This article is a detail guide to install Git on Debian.
How to Install Git on Debian
You can install Git on Debian from the following two methods:
Method 1: Install Git from Debian Repository
The Debian repository includes the Git repository, allowing users to install it on Debian through the “apt” command. However, since we are installing Git from the source repository, it’s a good to update the Debian packages list from the following command:
Now, install Git on Debian from the following command:
Check the Git version on Debian from the following command to confirm its installation:
From the above-given method, you won’t be able to install the updated version of Git on Debian.
Method 2: Install Git from GitHub Source
To install the Git latest version on Debian, the users must follow the below-given steps:
Step 1: Download Prerequisites
First, you must install some prerequisites on Debian from the following command:
Step 2: Download Git tar.gz File on Debian
Now, the Git latest version tar.gz file on Debian from the following command:
Ensure to download the latest version from here.
Step 3: Extract tar.gz File
To extract Git content on Debian, run the below-mentioned command:
Step 4: Setting up Git for Debian
Navigate to Git source directory on Debian:
Compile the Git files from the following command:
After completing the compilation, you can perform Git installation on Debian from the following command:
Step 5: Check Git Version on Debian
After completing the installation, close the terminal and reopen again. Then use the version command to confirm the installation of Git’s latest version on Debian.
The above confirms that the method successfully installed Git’s latest version on Debian.
The Git installation on Debian is simple from the source repository and requires only a single command. However, the method won’t install the updated Git version. The updated Git version can only be installed by downloading the latest tar.gz source file, extracting the files, and compiling them through the make command. The process may take time, but it will successfully install the latest Git version on Debian.