NB: you can use git to update git to the latest development version (not recommended).
For the latest stable version for your release of Debian/Ubuntu:
# apt-get install git
For Ubuntu, this PPA provides the latest stable upstream Git version:
# add-apt-repository ppa:git-core/ppa# apt update; apt install git
Alternatively (via Ask Ubuntu, w/ more details and work-arounds) you can:
If you receive an error about add-apt-repository command not found you may need to add the python-software-properties package or software-properties-common depending on your Ubuntu version.
Per these reccs... from Ionic.
Resources:
The online git book...
The GutHub help docs...
One quick example: cloning to a new local dir:
For
git
itself:git
to updategit
to the latest development version (not recommended).Alternatively (via Ask Ubuntu, w/ more details and work-arounds) you can:
Use the PPA from the maintainers of git on Ubuntu:
If you don't know what PPAs are, first read What are PPAs and how do I use them?
If you receive an error about
add-apt-repository
command not found you may need to add thepython-software-properties
package orsoftware-properties-common
depending on your Ubuntu version.Ubuntu 14.04:
sudo apt-get install software-properties-common
Ubuntu 13.10 or earlier:
sudo apt-get install python-software-properties