Source: medium.com

Problem: Ubuntu Won’t Upgrade to the Latest Git Version

I was running script that clone some git archives from GitHub and I got the following error:

Please upgrade your git client.
GitHub.com no longer supports git over dumb-http: https://github.com/blog/809-git-dumb-http-transport-to-be-turned-off-in-90-days

But when I tried to upgrade git, Ubuntu told me I already had the latest version:

$ sudo apt-get install git

Reading package lists... Done
Building dependency tree
Reading state information... Done
git is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

But I didn’t actually have the latest version.

Solution: Add the Software Source for the Ubuntu Git Maintainers Team

To get the very latest version of git, you need to add the PPA (Personal Package Archive) from the Ubuntu Git Maintainers Team to your Software Source list. Do that with the add-apt-repository command to add the PPA:

$ sudo add-apt-repository ppa:git-core/ppa

Then update the source list and upgrade git:

$ sudo apt-get update
$ sudo apt-get install git

Now you should be all set.

Tip: add-apt-repository Command not Found

When I first tried this, I got a “command not found” error:

sudo: add-apt-repository: command not found

If you get the same error, see this related article for the quick fix: Ubuntu Missing add-apt-repository Command