How to install Git on Debian 11.3

To Install Git On Debian 11.3

Introduction:

Git is a free and open-source software for tracking changes and can also be used to store content. It is a prominent version control system that handles numerous codes by maintaining the history and also possesses a remote repository. The main objective is to provide speed and integrity to the data.

Installation procedure:

Step 1: Check the OS version by using the below command

root@linuxhelp:~$ lsb_release –a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

Step 2: Switch to root user by using the below command

root@linuxhelp:~$ su
[sudo] password for linuxhelp: 

Step 3: Install the Git by using the below command

root@linuxhelp:~# apt install git
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  git-man 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 liberror-perl

0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 7,386 kB of archives.
After this operation, 37.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian bullseye/main amd64 liberror-perl all 0.17029-1 [31.0 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 git-man all 1:2.30.2-1 [1,827 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 git amd64 1:2.30.2-1 [5,527 kB]
Fetched 7,386 kB in 1s (4,938 kB/s)
Selecting previously unselected package liberror-perl.
(Reading database ... 155850 files and directories currently installed.)
Preparing to unpack .../liberror-perl_0.17029-1_all.deb ...
Unpacking liberror-perl (0.17029-1) ...
Selecting previously unselected package git-man.
Preparing to unpack .../git-man_1%3a2.30.2-1_all.deb ...
Unpacking git-man (1:2.30.2-1) ...
Selecting previously unselected package git.
Preparing to unpack .../git_1%3a2.30.2-1_amd64.deb ...
Unpacking git (1:2.30.2-1) ...
Setting up liberror-perl (0.17029-1) ...
Setting up git-man (1:2.30.2-1) ...
Setting up git (1:2.30.2-1) ...
Processing triggers for man-db (2.9.4-2) ...

Step 4: Check the downloaded Git version by using the below command

root@linuxhelp:~# git --version
git version 2.30.2

Step 5: Create the user name by using the below command

root@linuxhelp:~# git config --global user.name "linuxhelp"

Step 6: Create the Email ID by using the below command

root@linuxhelp:~# git config --global user.email user@linuxhelp.org

Step 7: View the created user name and email as shown in the image below

root@linuxhelp:~# nano ~/.gitconfig

Step 8: List the configuration by using the below command

root@linuxhelp:~# git config --list
user.name=linuxhelp
user.email=user@linuxhelp.org

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to install Git on Debian 11.3. Your feedback is much welcome.

FAQ
Q
Git using SSH or HTTPS?
A
Git used SSH protocol to securely transfer repository data over the internet. Uses public key encryption to secure data. Git with HTTPS uses public-key encryption-based authentication for doing every action like git push, git clone, git fetch and git pull, etc.
Q
What port is Git?
A
The native Git transport uses TCP port 9418. However, Git can also run over SSH (often used for pushing), HTTP, HTTPS, and less often others
Q
Is Git a programming language?
A
Git is not a programming language, but it's become incredibly important for computer programmers working in almost any language you can name. Today, Git is the de facto standard for what's known as version control software.
Q
What is the difference between GitHub and Git?
A
Git is a version control system that lets you manage and keep track of your source code history. GitHub is a cloud-based hosting service that lets you manage Git repositories.
Q
What is Git and why is it used?
A
Git is a DevOps tool used for source code management. It is a free and open-source version control system used to handle small to very large projects efficiently. Git is used to track changes in the source code, enabling multiple developers to work together on non-linear development.