Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install more recent (or latest) Git version in Debian 9

I want to install Git on Debian 9. I ran apt install git-all as it says on Git site but it installed version 2.11.0.

I thought that there was a need for packages update, but apt-get update and apt-get upgrade didn't change anything. It appears that this Git version is the latest stable for Debian 9.

I want to use a more recent Git version. What is the best I can do?

like image 771
exch_cmmnt_memb Avatar asked Mar 25 '26 11:03

exch_cmmnt_memb


1 Answers

Maybe a backports version for the Debian release you are using provides a more recent git version which satisfies your requirements.

Taking the Debian 11 (bullseye) release as an example, bullseye's default git package is on version 2.30.x, whereas bullseye-backport's git is on version 2.34.x. This more recent git version is especially desirable as it allows to sign commits with SSH keys.

First you need to add the bullseye-backports package source to your bullseye system (I don't know if e.g. the older stretch would allow to use bullseye-backports), then after an apt update, you will be able to install the backports git package:

echo "deb http://deb.debian.org/debian bullseye-backports main" >/etc/apt/sources.list.d/bullseye-backports.list

apt update
apt install git/bullseye-backports
like image 106
Abdull Avatar answered Mar 28 '26 01:03

Abdull