Donate to support Ukraine's independence.

19 Feb'15

Update Git on Debian 7 to Git 2.3

Add the following repository to the sources.list:

deb precise main
deb-src precise main

Now, run sudo apt-get update and get the following output:

W: GPG error: precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A1715D88E1DF1F24

And fix it by running

sudo apt-key adv --keyserver --recv-keys A1715D88E1DF1F24

Now you can run

sudo apt-get install git

And afterwards verify your setup:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.7 (wheezy)
Release:        7.7
Codename:       wheezy

$ git --version
git version 2.3.0

Now you can use simple push, new remote syntax and -C flag as well as many other features!

UPD (12.04.15):

It turned out that I forgot to describe the installation process for a libc6 dependency. We will install it from Debian testing.

First, you need to create a file /etc/apt/apt.conf.d/99defaultrelease:

APT::Default-Release "stable";

Then, /etc/apt/sources.list.d/testing.list:

deb    testing main contrib non-free
deb-src    testing main contrib non-free

deb         testing/updates  main contrib non-free

Run apt-get update and the execute:

apt-get install -t testing libc6

After this, repeat the installation command:

sudo apt-get install git

Thanks to Martin for pointing this problem out!