The Ubuntu git maintainers team has a PPA just for that
ppa:git-core/ppa
Just do:
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
Error: Unable to locate package add-apt-repository
If add-apt-repository
command is not found, install it first with:
sudo apt-get install software-properties-common
Error: failed to start the dirmngr
If you receive the error:
gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
then, install dirmngr
with:
sudo apt install dirmngr --install-recommends