How to Install Git on Debian 10 Linux
2 min read
Git is the world’s most popular distributed version control system used by many open-source and commercial projects.
With Git you can collaborate on projects with your fellow developers, keep track of your code changes, revert to previous stages, create branches and more. It is originally developed by Linus Torvalds , the creator of the Linux kernel.
This tutorial explains how to install and configure Git on Debian 10, Buster.
The Git package is included in the Debian’s default repositories and can be installed using the
apt package manager. Another installation option is to compile Git from the source which will allow you to install the latest Git version and to customize the build options.
sudo apt update
sudo apt install git
Verify the installation by printing the Git version:
At the time of writing this article, the current version of Git available in the Debian Buster repositories is
git version 2.20.1
That’s it, you have successfully installed Git on your Debian machine.
Now that you have Git installed it is recommended to set your Git commit email and username. To do that run the following commands:
git config --global user.name "Your Name"
git config --global user.email "firstname.lastname@example.org"
You can verify the changes with the following command:
git config --list
user.name=Your Name email@example.com
The configuration settings are stored in the
[user] name = Your Name email = firstname.lastname@example.org
To make other changes to your Git configuration you can either use the
git config command or edit the
~/.gitconfig file with your text editor .
When a new version of Git is added to standard Debian repositories you can update the Git package through your desktop standard Software Update tool or by running the following commands in your terminal:
sudo apt update
sudo apt upgrade
Installing Git on Debian Buster a matter of running a single command. To learn about how to use Git check the Pro Git book .
If you hit a problem or have feedback, leave a comment below.