Keeping track of source code is one of the essential skills that every developer needs to have. Git is one of the DevOps tools that help developers to manage their source code - from small to large projects. Git is an open-source version control tool that allows developers to push their code to host code platforms such as Github, BitBucket, and Gitlab. It helps them to perform code management tasks such as reverting to previous versions, branching, etc.
In this tutorial, we will install and configure Git on Debian 11 server. There are two approaches to installing Git. You can install from Debian repositories using the APT package manager or install from the source which provides the latest version of Git.
Method 1: Installing Git using APT package manager
To get started, be sure to update Debian's package index.
sudo apt update
Once the update is complete, install Git from Debian's APT repository using the simple command provided.
sudo apt install git
Once the installation is done, check the version of Git:
The output shows we have installed Git version 2.30.2.
Method 2: Installing Git from source
A better and more flexible option is to install Git from the source. While this may be a longer path to take, it will certainly give you the latest version of Git.
Once the installation is complete, head over to the Git's project which is hosted on Github
Navigate to the 'Master' branch and click on the 'Tags' link and choose the latest Git option which is usually the first option from the top. Avoid selecting the release candidate version (which bears the suffix rc). This is more like a Beta version and is likely to be buggy and unstable.
At the time of writing down this guide, the latest release of Git is Git v2.33.0. This is the release that we are going to install.
At the far right, click on the 'Code' button and then copy the 'Download ZIP' option link
Back to your Debian 11 server, download the zip file using the wget command.
To confirm that the configuration has been set up run the command:
git config --list
These details are written in the ~/.gitconfig file. You can additionally confirm by viewing the file.
You can now start using Git to host your code on any code hosting and collaborative platform such as Github. In this tutorial, we have walked you through the installation of Git on the Debian 11 server.
If this resource helped you, let us know your care by a Thanks Tweet.
Did you find this article helpful?
We are glad you liked the article. Share with your friends.
About The Author
Winnie is a Linux technical writer with over 3 years of experience with various Linux distributions and writing technical guides in Linux. She is passionate about FOSS technologies and always endeavor to learn new technologies. During my free time, I watch movies, listen to music, and catch up with tech news.