
Git is the most popular distributed version control system in the world. It used to track 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 tutorial, you will learn how to install Git on Debian 10 Buster.
Prerequisites
You must have logged in with non-root user account with sudo privileges.
Install Git
The Git package is available in the Debian’s default repositories. You can install Git using the apt package manager. There is also a alternate way to 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
On the completion of installation, you can verify by checking version:
git --version
git version 2.20.1
Configure Git
Now your Git is installed and 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
Once the 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 10 Buster. You can get more details about use of Git from Pro Git book.
Leave a Reply