Site icon DesignLinux

How to Install Git on Debian 11 Linux

how-to-install-git-on-debian-11

Git is the most famous distributed version control system in the world. It efficiently handles changes in source code for many open source and commercial projects. It allows to collaborate with programmers, revert to previous changes and create branches. In this article, you will learn how to install Git on Debian 11 Bullseye.

Prerequisites

You must have logged in with non-root user account with sudo privileges.

Installing Git

By default, Debian repositories includes the Git package. You can install Git using the apt package manager. You can also install latest version of Git from source. To install from apt manager is very simpler and we will use it in this article.

sudo apt update
sudo apt install git

Once the installation completed, you can verify by checking version:

git --version
git version 2.38.1

Configure Git

Once the installation finished, you need to configure it by setting up email address and username:

git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"

Don’t forget to replace with your real name and email address.

You can check entered details by typing:

git config --list
user.name=Your Name
user.email=youremail@example.com

These settings are stored at ~/.gitconfig file and you can see content as below:

You can make other git configuration changes by using git config command or you can use text editor to make changes to ~/.gitconfig file manually.

Update Git

When new release is available to standard Debian repositories, you can update the Git package using below command:

sudo apt update
sudo apt upgrade

Conclusion

In this guide, we show you how to install Git on Debian 11 Bullseye. You can get more details about use of Git from Pro Git book.

Exit mobile version