Here’s a short memo on how to tell apt-get about a new Git version.
Check if Git is installed and what version it’s on:
$ git --version git version 220.127.116.11
Ideally you would just go:
$ sudo apt-get install git
The Git version in apt-get is stuck to
18.104.22.168, that might be okay in most cases, but if you want the latest
2.3.4 (at the time of writing this), you need to add the latest Git to apt-get with the following command:
$ sudo add-apt-repository ppa:git-core/ppa
The repo is maintained by these people.
Now apt-get knows about the new Git, then install it:
# First update the apt-get package database $ sudo apt-get update # Then install git $ sudo apt-get install git
Check version and do a little dance:
$ git --version git version 2.3.4
If you get an error like:
sudo: add-apt-repository: command not found
Then you need to install the
$ sudo apt-get install software-properties-common python-software-properties
Comments would go here, but the commenting system isn’t ready yet, sorry. Tweet me @hiljaa if you want to make a correction etc.