Today in this tutorial will get to know how to install and configure Git on Debian 8 Linux.
Nowadays, Git is the most famous version control system, as it supports distributed architecture and functionalities, we called it distributed version control system. It used by much more open source and commercial projects.
It has the functionalities to track the code changes, create branches, revert the project to previous stages, and collaborate with team members and your fellow developers.
Linus Torvalds was the first person who initiated the Git project and developed it; He is the person who creates the Linux Kernel also.
I have done all stuff on Debian 8 what written in this article but hope it will also work on any Debian System.
Before continue with below process to install Git, make sure your operating system is Debian 8, and you have logged in as a user who is having sudo privileges.
Install Git with APT package Manager
The recommended and easiest way to install Git into the Debian system is by using the native package manager (APT) from the default repository of Debian Operating System.
This process will install the Git with the version available in the Debian repository but if you want to install any other version or latest version of Git, follow the process of Installing Git from Source tutorial.
You can install Git into Debian System using APT package by following steps:
Step 1- Update Debian repository’s package index
$ sudo apt-get update or $ sudo apt update
$ sudo apt-get install git Or $ sudo apt install git
$ git –version
Output: git version 2.11.0
Install Git from Source
You can use Source installation for Git as another option of installation for Debian Operating system. By using this installation, you can use the latest version or any version you like.
The only drawback of source installation is not being able to maintain using the APT package manager.
In the Linux operating system, when you use a package manager to install any application, it will install all required dependencies automatically, but when you use source installation, you need to install all dependencies manually.
So, first, update the package list and install all dependencies for Git on Debian system using the following command.
$ sudo apt update $ sudo apt install make libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip
Now download the Git source file in the /usr/src directory. Generally, we kept all source files at this location, to do this first need to change the directory with the following command:
$ cd /usr/src/
$ sudo wget https://github.com/git/git/archive/v2.22.0.tar.gz -O git.tar.gz
$ sudo tar –xzf git.tar.gz $ cd git-*
$ sudo make prefix=/usr/local all
$ sudo make prefix=/usr/local install
$ sudo export PATH=$PATH:/usr/src/git-2.22.0 $ git --version
Output: git version 2.22.0
$ git config - -global user.name “Your UserName” $ git config - -global user.email “Your email ID”
$ git config --list
Output: user.name=satish [email protected]
[user] name = satish email = [email protected]
Now you have learned Git Version control system installation on Debian 8 Operating system; you can also check highly recommended book on git – Pro Git to learn more about Git.
If you get any problem while installing Git into your system or have any feedback, feel free to leave a comment below.