It is easiest to install Git on Linux using the preferred package manager of your Linux distribution.
For the latest stable version for your release of Debian/Ubuntu.
To update the package list, use the following command:
sudo apt-get update
We now install git with the following command:
sudo apt-get install -y git
For further information, read the Git documentation.