As described by the linked Stackoverflow answer, run these commands:
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git
git --version
This will get you Git 2.6.4 (as of Dec 2015).
If you don't have add-apt-repository
yet, install it with:
sudo apt-get install python-software-properties software-properties-common